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 |
qman
Constraint Violating Yak Guru
442 Posts |
Posted - 2012-09-12 : 14:49:08
|
Based on today's date, how can I select all records from begining of the year up to current date...?Sounds simple..... |
|
sunitabeck
Master Smack Fu Yak Hacker
5155 Posts |
Posted - 2012-09-12 : 14:51:02
|
[code]SELECT *FROM YourTableWHERE datecolumn >= DATEADD(YEAR, DATEDIFF(YEAR, 0, GETDATE()), 0) AND datecolumn <= GETDATE();[/code] |
 |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
|
|
|
|