Subject Re: [IBO] Date format issue
Author Jay
Jason Wharton wrote:
>
> > IB_Query1.ParamByName('SomeDate').AsDate:=strtodate(Edit1.Text);
>
> Rather than use a parameter I have a routine in IB_Utils or IB_Parse
> that
> takes a TDateTime input and returns a string that the interbase parser
> will
> recognize. This allows the client's date format to be converted to the
> server format.
>
> It's called something like getIBDateLiteral

Thank you Hellen and Jason for your input. Jason's hint solved the
problem to some degree.

The most confusing part, however, was that
StoredProc.ParamByName('A_DATE').AsString accepts date formats as
defined by a machines regional settings. 'AsDate' solved the problem
here.

In contrast, OnPrepareSQL must have a date format which interbase
supports. 'get_IBDateLiteral' in 'IB_Parse.pas' did the trick in that
instance.

Providing date formats in above manner enables the user to assemble
(regional settings) any date format they might want, and without to run
into regional conflicts or even worse to hard code.

Cheers

Johannes