cybercop23
IS-IT--Management
Hi all.
I need to sumarize sales by day for the past month. The issue is that my date field is smalldatetime since I get updated sales every 15 minutes.
Here's my select statement:
Even if I do this, it still won't work:
I know I can create a separate view and base my query off of that view, but I'm thinking there has to be a way to do this in one shot. Any ideas?
Thanks much.
AB
I need to sumarize sales by day for the past month. The issue is that my date field is smalldatetime since I get updated sales every 15 minutes.
Here's my select statement:
Code:
select Str,CONVERT(varchar(10), [TimeStamp], 101) as SDate,sum(NetSalesAmount) as Sales
from SaleUpdates
where TimeStamp >= getdate()-30
group by Str,TimeStamp
order by Str,SDate
Even if I do this, it still won't work:
Code:
group by Str,CONVERT(varchar(10), [TimeStamp], 101)
I know I can create a separate view and base my query off of that view, but I'm thinking there has to be a way to do this in one shot. Any ideas?
Thanks much.
AB