Viewing 3 posts - 61 through 63 (of 63 total)
Depending on whether your data will eventually span multiple years you may want to either add DATEPART(year, Date_occur) or add a WHERE condition if it is important to determine which...
September 29, 2006 at 7:14 am
#663292
You beat me to it, Dan. I was just going to suggest using the TOP keyword.
September 28, 2006 at 8:29 am
#663010
Try this one:
SELECT [ID], Message, Date_and_Time
FROM <Table Name>
WHERE Date_and_Time >= CONVERT(DATETIME, '20060501')
If your table is indexed on Date_and_Time, this should be able to use that index.
September 7, 2006 at 7:29 am
#659067