dbTalk Databases Forums  

Date()

microsoft.public.sqlserver.olap microsoft.public.sqlserver.olap


Discuss Date() in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
LAB
 
Posts: n/a

Default Date() - 01-07-2005 , 10:49 AM






Hi,

Today, 01-07-2005 (jan. 7th. 2005)

Using vba!Date() in AS returns 01-07-2005 (juli 1.th. 2005). This is not
just american style, because dateadd("d", -1, date()) returns 30-06-2005
(june 30th. 2005)

Does AS really mix up day and month???

From SQL using getdate() as well as from MS Access using date(), the correct
date is returned.

Regards,
Lasse



Reply With Quote
  #2  
Old   
Deepak Puri
 
Posts: n/a

Default Re: Date() - 01-07-2005 , 04:49 PM






Hmmm - I get the correct value: 01/06/2005 (US locale) when I try it.
What does DateSerial() return in your case?

DateAdd("d", -1, DateSerial(2005, 1, 7))


- Deepak

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Reply With Quote
  #3  
Old   
LAB
 
Posts: n/a

Default Re: Date() - 01-08-2005 , 07:20 AM



DateSerial() returns the correct value. Now() also works fine.

Today (8th. jan), Date() returns 1. august.... Wonder what will happen the
13th jan.?

Regards
Lasse

"Deepak Puri" <deepak_puri (AT) progressive (DOT) com> skrev i en meddelelse
news:OfdEXsQ9EHA.3588 (AT) TK2MSFTNGP10 (DOT) phx.gbl...
Quote:
Hmmm - I get the correct value: 01/06/2005 (US locale) when I try it.
What does DateSerial() return in your case?

DateAdd("d", -1, DateSerial(2005, 1, 7))


- Deepak

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.