Aug 31, 2001 #1 vlitim Programmer Sep 2, 2000 393 GB I have a date field in my dbase and in the select statement I want to check to make sure that the year part of it is = to the current year. so something like: select * from events where offDate <= yearNow can someone please help me on this cheers Tim
I have a date field in my dbase and in the select statement I want to check to make sure that the year part of it is = to the current year. so something like: select * from events where offDate <= yearNow can someone please help me on this cheers Tim
Aug 31, 2001 #2 fluteplr Programmer Oct 23, 2000 1,599 US select * from events where year(offdate) = year(getdate()) probably would not optimise to well, but would work fine if the table was small. select * from events where offdate between str(year(getdate()))+'-01-01' and str(year(getdate()))+'-12-31 11:59:59' should optimise just fine Upvote 0 Downvote
select * from events where year(offdate) = year(getdate()) probably would not optimise to well, but would work fine if the table was small. select * from events where offdate between str(year(getdate()))+'-01-01' and str(year(getdate()))+'-12-31 11:59:59' should optimise just fine