Please start any new threads on our new site at http://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Old Forums
 CLOSED - General SQL Server
 getdate
 Forum Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

lemondash
Posting Yak Master

United Kingdom
159 Posts

Posted - 05/21/2007 :  07:26:59  Show Profile  Click to see lemondash's MSN Messenger address
What to get todays date working in this script. Any idea where i'm going wrong ?

select
H.IsoDate,
HI.Country,
HI.Center,
H.ExchangeCode,
HC.Holiday,
H.HolidayCode
from
Holidays H
join
HolidayInfo HI
on
HI.Code = H.ExchangeCode
join
HolidayCodes HC
on
H.HolidayCode = HC.Code
where
H.isodate = getdate()

The date format in the h.isodate col is like this:
'2005-06-24 00:00:00.000'

Hope that helps

khtan
In (Som, Ni, Yak)

Singapore
17689 Posts

Posted - 05/21/2007 :  07:30:18  Show Profile

where
H.isodate = dateadd(day, datediff(day, 0, getdate()), 0)



KH

Go to Top of Page

lemondash
Posting Yak Master

United Kingdom
159 Posts

Posted - 05/21/2007 :  07:35:16  Show Profile  Click to see lemondash's MSN Messenger address
Cheers !!!!!!!!!!!!!!!!!
Go to Top of Page

madhivanan
Premature Yak Congratulator

India
22864 Posts

Posted - 05/21/2007 :  10:03:07  Show Profile  Send madhivanan a Yahoo! Message
More on dates
http://www.sql-server-performance.com/fk_datetime.asp

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
  Previous Topic Topic Next Topic  
 Forum Locked
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000