View previous topic :: View next topic |
Author |
Message |
Param Beginner

Joined: 31 Mar 2003 Posts: 16 Topics: 7
|
Posted: Thu Nov 13, 2003 1:52 am Post subject: Smalldatetime |
|
|
Hi folks,
What is the cobol equivalent of DB2 data type 'Smalldatetime'
Thnx in advance,
Param |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Thu Nov 13, 2003 6:23 am Post subject: |
|
|
Param,
As far as I know DB2 on mainframe does not have data type SMALLDATETIME. Which version of DB2 are you using?
I Know sql server and sybase have smalldatetime data types.
Kolusu |
|
Back to top |
|
 |
Param Beginner

Joined: 31 Mar 2003 Posts: 16 Topics: 7
|
Posted: Thu Nov 13, 2003 6:27 am Post subject: |
|
|
Kolusu,
I am extremely sorry...This was not in DB2...Actually it was in SQL...
Thnx,
Param |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Thu Nov 13, 2003 6:43 am Post subject: |
|
|
param,
In Sql Server ,the smalldatetime data type stores dates and times of day with less precision than datetime. SQL Server stores smalldatetime values as two 2-byte integers. The first 2 bytes store the number of days after January 1, 1900. The other 2 bytes store the number of minutes since midnight. Dates range from January 1, 1900, through June 6, 2079, with accuracy to the minute.
Basically smalldatetime is stored in 2 parts of 2 byte integers which is equivalent to smallint in DB2.
I suggest that you define 2 columns with data type smallint
The first column would have the number of days. The second column would have number of minutes since midnight.
Hope this helps...
cheers
kolusu |
|
Back to top |
|
 |
|
|