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 |
|
apple
Starting Member
3 Posts |
Posted - 2009-02-05 : 01:48:23
|
| Hi,Appreciate your help on this task..I have columns contains value supposed to be in date type. But somehow it is stored in integerselect mydate from mytable;mydate-------120667065512066770901206677527I need to view the actual date. Can anyone help me? |
|
|
bklr
Master Smack Fu Yak Hacker
1693 Posts |
Posted - 2009-02-05 : 02:11:32
|
| try like thisdeclare @t intset @t = 1206670655select @tselect dateadd(ss,@t,'1/1/1970')select dateadd(ss,urcolumnname,'1/1/1970') from urtable |
 |
|
|
apple
Starting Member
3 Posts |
Posted - 2009-02-05 : 02:49:38
|
| Hi bklr,The date match but not the time. Any ideas on getting the correct time also? Thks in advance! |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2009-02-05 : 03:27:36
|
What date AND time do the three sample data represent? E 12°55'05.63"N 56°04'39.26" |
 |
|
|
apple
Starting Member
3 Posts |
Posted - 2009-02-05 : 03:37:23
|
| Here you go..After i run this sql;select mydate,dateadd(ss,mydate,'1/1/1970 ')newdate from mytable;mydate newdate1206670655 28/03/2008 2:17:351206677090 28/03/2008 4:04:501206677527 28/03/2008 4:12:07 |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2009-02-05 : 03:50:13
|
But you wrote the time is not correct. The date is correct.What should the time be? E 12°55'05.63"N 56°04'39.26" |
 |
|
|
bklr
Master Smack Fu Yak Hacker
1693 Posts |
Posted - 2009-02-05 : 05:14:28
|
| for ur data mydate-------120667065512066770901206677527give us expected date? and time? for every record |
 |
|
|
|
|
|