BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

DB2 -- datetime value is out of range

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (SQL Servers)
View previous topic :: View next topic  
Author Message
Douglas
Guest





PostPosted: Tue Dec 23, 2003 2:06 pm    Post subject: DB2 -- datetime value is out of range Reply with quote



A client is getting the following error from the database while filling the
params. of a prepared query...
SQL0181N The string representation of a datetime value is out of range.
SQLSTATE=22007

We support just about all DB platforms and will be going to ADO very soon.
In the meantime, we are going through the BDE and below is how I am doing
this. Any suggestions?

In an earlier function, ProcDate = Date (today's date without the timestamp)

This works on our DB2, but does not work on the client's version of DB2...
MyQuery.ParamByName('PROCESSDATE').AsDateTime := ProcDate;

This works on ours and on the client's version of DB2, but may not work on
all of the other platforms...
MyQuery.ParamByName('PROCESSDATE').AsDate := ProcDate;

Thanks,
Samson


Back to top
Tony J Hopkinson
Guest





PostPosted: Thu Dec 25, 2003 12:19 am    Post subject: Re: DB2 -- datetime value is out of range Reply with quote



On Tue, 23 Dec 2003 09:06:55 -0500, "Douglas" <SSA (AT) LV (DOT) com> wrote:

Quote:
A client is getting the following error from the database while filling the
params. of a prepared query...
SQL0181N The string representation of a datetime value is out of range.
SQLSTATE=22007

We support just about all DB platforms and will be going to ADO very soon.
In the meantime, we are going through the BDE and below is how I am doing
this. Any suggestions?

In an earlier function, ProcDate = Date (today's date without the timestamp)

This works on our DB2, but does not work on the client's version of DB2...
MyQuery.ParamByName('PROCESSDATE').AsDateTime := ProcDate;

This works on ours and on the client's version of DB2, but may not work on
all of the other platforms...
MyQuery.ParamByName('PROCESSDATE').AsDate := ProcDate;

Thanks,
Samson


Depends on the client's date time format in windows. Look at their
regional setup.

Always much better to user FornatDateTime and put your date/ times in
as string in the format the database server understands.


Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (SQL Servers) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.