Invalid argument to date encode

Discussion of open issues, suggestions and bugs regarding usage of dbExpress drivers for SQL Server in Delphi and C++Builder
Post Reply
wdwhitaker

Invalid argument to date encode

Post by wdwhitaker » Tue 21 Dec 2004 20:49

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.

Ikar
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Re: Invalid argument to date encode

Post by Ikar » Wed 22 Dec 2004 08:01

We couldn't reproduce the problem.
Please send us complete small sample to demonstrate it and include script to create server objects.

ddudley3

I'm getting the same error

Post by ddudley3 » Tue 05 Jul 2005 17:00

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?

Ikar
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Post by Ikar » Wed 06 Jul 2005 09:10

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.

Post Reply