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 |
|
kfluffie
Posting Yak Master
103 Posts |
Posted - 2009-01-10 : 12:42:33
|
| Hello!I am writing a query for a project in a class. I am going to create a particular view.However, I come up with a problem. One of output from the view is that I should display the top 5 sellers which have sold most the last month.The last month is the problem.First, I though it was a simple task and was going to use datediff:datediff(mm, "Date Column", GetDate())However, that of course didn't work. I tried some other examples with datediff and datepart (with month, day of year) etc. but the problems always lies at the yearly break.Do I need to make some condition statement or is there any easier way to do this?I have read a little post about converting it to Julian format, but I want to hear your input first.Thanks in advance!Best Regards,KFluffie |
|
|
kfluffie
Posting Yak Master
103 Posts |
|
|
|
|
|