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.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 SQL getdate() is off one digit from excel =Today

Author  Topic 

DevintheDude
Starting Member

3 Posts

Posted - 2008-07-02 : 19:54:35
sql function convert(int,getdate()) is off one digit from
excel function =today formatted as general

Excel is one digit higher why is that?

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-07-02 : 21:23:49
quote:
Originally posted by DevintheDude

sql function convert(int,getdate()) is off one digit from
excel function =today formatted as general

Excel is one digit higher why is that?


Can you explain what you want to get from current date?

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2008-07-02 : 22:43:34
"Excel is one digit higher why is that?"
I can't remember the reason, try google for it

anyway
in SQL,
0 is 1900-Jan-01
in Excel
0 is 1900-Jan-00


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-07-03 : 04:40:52
No.

Date Zero for Excel is December 30, 1899.
Date Zero for MS SQL is January 1, 1900.

The difference is two days.



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2008-07-03 : 04:57:01
I got the excel date 0 from here http://www.cpearson.com/excel/datetime.htm




KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page
   

- Advertisement -