Yak Posting Veteran
Posted - 02/28/2013 : 04:57:25
| I need to write a sql query which should run end of every month and send a excel report. Is this possible in scheduling??
here is the sample query:
DATENAME(day,bookDate) as day, DATENAME(Month,BookDate) as Month,
COUNT(Invoice) AS [Total Bookings],
cast (Sum(Negotiated) as decimal (22,2)) AS [Total Sale Price],introducer
WHERE BookDate >= '2001-01-01'
AND BookDate <= '2020-01-01'
GROUP BY DATENAME(Month,BookDate) , DATENAME(day,BookDate),introducer,
ORDER BY DATEPART(dd,BookDate),DATEPART(MM,BookDate),introducer
Thanks in Advance..