Filter in a SQL view to make column show records with current year -


i tried find other questions may have answered nothing related i'm doing. making view has 2 joined tables in it. need records show have current year in date, when make report in visual studio, user able see has been done current year. have experience in access still trying figure out sql.

you can use "year" function on datetime variable, this:

select * tablename year(date) = 2013 

or if current year needs dynamic:

select * tablename year(date) = year( getdate() ) 

Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -