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
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Date passing

Author  Topic 

kerstin@balancestudios.co
Starting Member

1 Post

Posted - 2007-04-27 : 18:11:44
I am passing a datetime object to my storedprocedure. since it is datetime and i am looking exactly for an event at this passed date i never get it back because they have different dates then the datetime object passes is there a way that i could say something like this
((Year)EventStartDate = (Year)@startdate)

thank you

cvraghu
Posting Yak Master

187 Posts

Posted - 2007-04-27 : 18:36:26
Are you trying to get all records for the passed in year ? If so you can use year function -

Where
Year(EventStartDate) = Year(@startdate)

Look into Books online for date related functions.
Go to Top of Page
   

- Advertisement -