johnpayback
IS-IT--Management
I need to have this statement pull the count for each day for the past 365 days. Currently it will pull the count every night for the previous day but I need it to pull the count for each of the past 365 days and insert them separately based on each day. I do not need to get the total count for the past 365 days...that is easy by changing the -1 to -365. Is there a way to do this with a loop or how can I accomplish this with VBScript? Below is the SQL statement that I need to use in the script.
thks JP
Code:
Select count(*) as CallCount,
dateadd(d,-1,getdate()) as CallDate,
'CON' as Site
From dbo.master_index where FileDateTime >= convert(char(10),dateadd(d,-1,getdate()),110) AND FileDateTime <convert(char(10),getdate(),110)
thks JP