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
 Old Forums
 CLOSED - General SQL Server
 getdate

Author  Topic 

lemondash
Posting Yak Master

159 Posts

Posted - 2007-05-21 : 07:26:59
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)

17689 Posts

Posted - 2007-05-21 : 07:30:18
[code]
where
H.isodate = dateadd(day, datediff(day, 0, getdate()), 0)
[/code]


KH

Go to Top of Page

lemondash
Posting Yak Master

159 Posts

Posted - 2007-05-21 : 07:35:16
Cheers !!!!!!!!!!!!!!!!!
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-05-21 : 10:03:07
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
   

- Advertisement -