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 |
|
kranthi_victroy
Starting Member
5 Posts |
Posted - 2007-08-24 : 11:48:21
|
| Hi, I have to check month of current date with all rows of month in the table XYZ. If there is any difference, we have to return error message. I am using datediff function but I am getting error at 'MM'. DateDiff(MM,Select getDate(), Select date1() from xyz). can any body helpme in solving this issue. |
|
|
jimf
Master Smack Fu Yak Hacker
2875 Posts |
Posted - 2007-08-24 : 11:53:47
|
| SELECT DATEDIFF(month,getdate(),date1)FROM xysJim |
 |
|
|
mwjdavidson
Aged Yak Warrior
735 Posts |
Posted - 2007-08-24 : 11:54:40
|
| [code]SELECT DATEDIFF(MM, GETDATE(), Date1) FROM xyz[/code]Mark |
 |
|
|
jimf
Master Smack Fu Yak Hacker
2875 Posts |
Posted - 2007-08-24 : 11:55:27
|
| or probablySELECT *FROM xyzWHERE DATEDIFF(month,getdate(),date1) >0 |
 |
|
|
kranthi_victroy
Starting Member
5 Posts |
Posted - 2007-08-24 : 11:58:31
|
| Thankyou |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
|
|
|
|
|