[DUG] firebird query parameters behaving oddly
Steve Peacocke
steve.peacocke at gmail.com
Tue Jul 10 12:49:33 NZST 2007
On 10/07/07, Tracey <tracey at logis.co.nz> wrote:
> Difficult.
>
> I use a javascript calendar picker to populate dates formatted dd/MM/yyyy
> (user requirements) which is passed via "textbox.value" to a javascript
> function which in turn passes the value directly back to my Delphi app.
>
Good Afternoon Tracey,
Could you use EncodeDate(), which will ensure that you are passing the
actual date as you would like. E.g. ...
// sDate = your date string = dd/mm/yyyy = '10/07/2007'
// d, m, y : Word;
Try
d := StrToInt(copy(sDate, 1, 2));
m := StrToInt(copy(sDate, 4, 2));
y := StrToInt(copy(sDate, 7, 4));
MyDate := EncodeDate(y, m, d);
except
ShowMessage('Not a date');
end;
Steve
--
Steve Peacocke
http://stevepeacocke.blogspot.com/
More information about the Delphi
mailing list