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 |
ann
Posting Yak Master
220 Posts |
Posted - 2007-04-10 : 10:26:27
|
How do I find if a field is less than or equal to system date, where PCDate <= systemdate (today or in the past)? I was using datediff but that doesn't seem right?Thanks |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-04-10 : 10:29:09
|
WHERE PcDate <= CURRENT_TIMESTAMPorWHERE PcDate <= GETDATE()These two will get you all records until this very millisecond.If you want yesterdays and earlier records only, try thisWHERE PcDate < DATEADD(DAY, DATEDIFF(DAY, 0, CURRENT_TIMESTAMP), 0)Peter LarssonHelsingborg, Sweden |
 |
|
ann
Posting Yak Master
220 Posts |
Posted - 2007-04-10 : 10:30:12
|
Thank you for such a quick response :) |
 |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2007-04-11 : 08:56:52
|
http://sql-server-performance.com/fk_datetime.asp for more informations on datesMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|