Page 1 of 1

Invalid argument to date encode

Posted: Tue 21 Dec 2004 20:49
by wdwhitaker
Getting this message "Invalid argument to date encode" when applying updates. Calls a stored procedure that inserts a record and returns the identity field. passes a datetime field that is converted to TSQLTimeStamp format when passed.

Re: Invalid argument to date encode

Posted: Wed 22 Dec 2004 08:01
by Ikar
We couldn't reproduce the problem.
Please send us complete small sample to demonstrate it and include script to create server objects.

I'm getting the same error

Posted: Tue 05 Jul 2005 17:00
by ddudley3
I get the same error: "Invalid argument to date encode" when I try selecting on date params on a query.

Query for example is

"Select f1,f2,f3....
from A
where A.datetime >= :dtfrom and A.datetime <= :dtTo
"
When I set my dtfrom and dtTo parameters in Delphi 2005 I get this error thrown on the Open call

I've tried setting the Datatype and it hasn't helped.
Anything I can try?

Posted: Wed 06 Jul 2005 09:10
by Ikar
Most probably, you set parameters values using AsString. Try to use AsDateTime or AsSQLTimeStamp. If you call StoredProc, then due to incorrect processing in dbExpress re-assigning parameter type for StoredProc you must use only AsSQLTimeStamp.