Re: Running totals on a select count statement
From: zack (anonymous_at_discussions.microsoft.com)
Date: 03/11/04
- Next message: ricky: "Convert string to Number"
- Previous message: zack: "Re: Running totals on a select count statement"
- In reply to: zack: "Re: Running totals on a select count statement"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 11 Mar 2004 11:41:12 -0800
Changed again
"where AR2.Creation_Date<= convert(Char(10), AR.Creation_Date, 101)" =>
"where AR2.Creation_Date-1<= convert(Char(10), AR.Creation_Date, 101)"
Working select=>
SELECT convert(Char(10), AR.Creation_Date, 101) AS DateWritten, COUNT(AR.Creation_Date) AS Written,
(
Select count(AR2.Creation_Date) from dbo.vw_Nothing AR2
where AR2.Creation_Date-1<= convert(Char(10), AR.Creation_Date, 101)
)
as RunningTotal
FROM dbo.vw_Nothing AR
GROUP BY DATEPART(yy, AR.Creation_Date), DATEPART(mm, AR.Creation_Date), DATEPART(dd, AR.Creation_Date), CONVERT(Char(10), AR.Creation_Date, 101)
- Next message: ricky: "Convert string to Number"
- Previous message: zack: "Re: Running totals on a select count statement"
- In reply to: zack: "Re: Running totals on a select count statement"
- Messages sorted by: [ date ] [ thread ]