Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
sqlnovice
Starting Member
10 Posts |
Posted - 2006-01-23 : 17:00:16
|
| How to cast a decimal as date? Original values are like 71205, 92904, 93004.I've tried SUBSTRING(DIGITS(Date),1,2) CONCAT '/' CONCAT SUBSTRING(DIGITS(Date),3,2) CONCAT '/' CONCAT SUBSTRING(DIGITS(Date),5,2) as theDateThe resulting table looks ilke...COST INVOICE Q ORDERNUM PARTNUMBER THEDATE716.80 1361008 1 425595 20-1853-1 07/12/054858.00 1278661 1 326449 DSP9602-W-DD 09/29/04122.47 1279101 1 326441 20-1644-1 09/30/04However, the above won't sort as a *real* date would. DB2 for iSeries SQL doesn't seem to have a CONVERT function. What else might work? |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2006-01-23 : 18:02:31
|
| This is a MS SQL Server forum. Your question will be better answer in a DB2 forum.Try http://www.dbforums.com----------------------------------'KH'I do work from home but I don't do homework |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-01-24 : 01:17:24
|
| And it is better to use DateTime column to store Date than using int, varchar, etcMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|