SQL and dateformat 
Author Message
 SQL and dateformat

How do I find out what datetime format i should use in SQL statements?
Is it hidden in some system table? Do I have to cast the datetime parameter?

The following sql from command centre fails

select MAX(PKTRID) from TRANSMISSION where FKPRID = 1 and TRANSDATE =
'1/1/2001 01:01:00' and SUCCESS = 'F'

error message:
DBA2191E SQL execution error.

com.ibm.db.DataException: A database manager error occurred. : [IBM][CLI
Driver][DB2/NT] SQL0180N  The syntax of the string representation of a
datetime value is incorrect.  SQLSTATE=22007

--
Johan



Sat, 05 Jul 2003 19:44:12 GMT
 SQL and dateformat

You want this format for you timestamp:

2001-1-1-01.01.00

or

2001-01-01-01:01:00

Quote:

> How do I find out what datetime format i should use in SQL statements?
> Is it hidden in some system table? Do I have to cast the datetime parameter?

> The following sql from command centre fails

> select MAX(PKTRID) from TRANSMISSION where FKPRID = 1 and TRANSDATE =
> '1/1/2001 01:01:00' and SUCCESS = 'F'

> error message:
> DBA2191E SQL execution error.

> com.ibm.db.DataException: A database manager error occurred. : [IBM][CLI
> Driver][DB2/NT] SQL0180N  The syntax of the string representation of a
> datetime value is incorrect.  SQLSTATE=22007

> --
> Johan



Sat, 05 Jul 2003 21:59:53 GMT
 SQL and dateformat
The date/time format and length are set in the DB2 sub-system parameters
or ZPARMS.  Look at paramaters DATE, TIME, DATELEN, and TIMELEN.  A
timestamp with DATE and TIME formats of ISO gives you:
yyyy-mm-dd-hh.mm.ss.mmmmmm

Norm Wong


Quote:

> You want this format for you timestamp:

> 2001-1-1-01.01.00

> or

> 2001-01-01-01:01:00


> > How do I find out what datetime format i should use in SQL
statements?
> > Is it hidden in some system table? Do I have to cast the datetime
parameter?

> > The following sql from command centre fails

> > select MAX(PKTRID) from TRANSMISSION where FKPRID = 1 and TRANSDATE
=
> > '1/1/2001 01:01:00' and SUCCESS = 'F'

> > error message:
> > DBA2191E SQL execution error.

> > com.ibm.db.DataException: A database manager error occurred. :
[IBM][CLI
> > Driver][DB2/NT] SQL0180N  The syntax of the string representation of
a
> > datetime value is incorrect.  SQLSTATE=22007

> > --
> > Johan

Sent via Deja.com
http://www.deja.com/


Sat, 05 Jul 2003 23:05:52 GMT
 
 [ 3 post ] 

 Relevant Pages 

1. sql server dateformat

2. sql server dateformat

3. SQL Server 7 DateFormat

4. SQL 2000 set dateformat doesn't work?!

5. Sql dateformat

6. set DATEFORMAT

7. SET DATEFORMAT doesn't work in sp

8. set dateformat problem

9. How can set dateformat in permanently mode?

10. Dateformat

11. DateFormat Problem

12. DateFormats


 
Powered by phpBB® Forum Software