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 |
Russ Hendrick
Starting Member
1 Post |
Posted - 2013-04-10 : 22:57:56
|
Here is my code that is working Select * from StmnDetail where PDate BETWEEN CONVERT(DATETIME, '2011-12-01 00:00:00', 102) AND CONVERT(DATETIME, '2012-11-30 00:00:00', 102) Is what I would like to do is make the years are current year -1 and current year. I was thinking something like thisselect(DATEPART(year,getDate())-1) + '12-01 00:00:00')This will throw a convert error what can I do to make the year dynamic but not any thing else?The Column type is Datetime and can not be changed.Thanks in advance |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
|
|
|
|
|
|