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 |
|
Petronas
Posting Yak Master
134 Posts |
Posted - 2009-04-28 : 12:08:56
|
| Hi All,I have the below query: select sale_code, count(*),sales_datefrom Sales_Events (nolock)where sales_id in ('AB02', 'CY02', 'NAB02')group by sales_code,sales_dateWhat I want is the Rolling past 10 day count.So if I run my query today I want to get the counts for the past 10 days.Using SQL server 2005Thanks for your help,Petronas |
|
|
Transact Charlie
Master Smack Fu Yak Hacker
3451 Posts |
Posted - 2009-04-28 : 12:12:30
|
This?select sale_code , count(*),sales_datefrom Sales_Events (nolock)where sales_id in ('AB02', 'CY02', 'NAB02') AND sales_date >= DATEADD(DAY, -10, GETDATE())group by sales_code,sales_dateCharlie===============================================================Msg 3903, Level 16, State 1, Line 1736The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION |
 |
|
|
Petronas
Posting Yak Master
134 Posts |
Posted - 2009-04-28 : 12:19:23
|
| Hi Transact Charlie,I got the solution. Appreciate your help.Thanks again,Petronas |
 |
|
|
Transact Charlie
Master Smack Fu Yak Hacker
3451 Posts |
Posted - 2009-04-28 : 12:21:08
|
| What was your solution?Charlie===============================================================Msg 3903, Level 16, State 1, Line 1736The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION |
 |
|
|
|
|
|
|
|