Subject Re: [IBO] Exception 335544334: conversion error from string "ABCDEFAA"
Author Aage Johansen
Ed Dressel wrote:
> ... Here's my Delphi code that creates the SQL:
>
> lIBQ.SQL.Text :=
> 'Select Log_ID, CodeGiven From ClientLog ' +
> ' where Client_ID = ' + IntToStr(aClientId) +
> ' and MachineID = ' + IntToSTr(lMachID) +
> ' and Expires_DateTime = ''' +
> FormatDateTime('dd-mmm-yyyy', aExpireDate) + '''';
>
> It seems that it has something to do with the particular values I am
> using as I can change them and they work just fine.


In any case, why not use parameters?

Select Log_ID, CODEGIVEN
From ClientLog
where Client_ID = :ClientID
and MachineID = :MachineID
and Expires_DateTime = :ExpireDate

Doing e.g.
lIBQ.ParamByName('ExpireDate').AsDateTime:=aExpireDate:
will save you any conversion hassels.


--
Aage J.