Subject | Re: [IBO] Dates in TIBOQuery vs. PrepareSQL |
---|---|
Author | Tony Masefield |
Post date | 2005-10-13T15:12:20Z |
--- In IBObjects@yahoogroups.com, Helen Borrie <helebor@t...> wrote:
complex (i.e. learning curve) than I had envisaged at first.
Progression is gradual but assured with your help.
Will use your approach from now one. Complicating factor was the
info in the IBO GSTG IRO the information on 'OnPrepareSQL' which was
what I was following. Somewhere I lost out on Paramatized Queries
(paramter bindings). Thanks for 'jogging' my memory.
Rgds,
Tony
>> First, PLEASE TRIM YOUR MESSAGES !!!OK, sorry, my mistake!
>
>apostrophes in
> As Alan pointed out, doubling is the correct way to escape
> Pascal (and in Firebird, as well, as it happens!)not the
>
> However, relying on date literals in SQL from the client side is
> recommended way to do this, if it can possibly be avoided. Useparameters
> and then, in your "before" event, use AsDate or AsDateTime toassign the date.
>Thanks (again) Helen. The change from desktop to server is more
> viz.
>
> MyDataset.SQLWhereItems.Add('where ADate >= :ADate');
>
> Then (assuming you're using the search in a dataset):
>
> MyDataset.ParamByName('ADate').AsDateTime := YourDateTimeVariable;
>
> Helen
>
complex (i.e. learning curve) than I had envisaged at first.
Progression is gradual but assured with your help.
Will use your approach from now one. Complicating factor was the
info in the IBO GSTG IRO the information on 'OnPrepareSQL' which was
what I was following. Somewhere I lost out on Paramatized Queries
(paramter bindings). Thanks for 'jogging' my memory.
Rgds,
Tony