I have a data driven subscription which delivers a report to an email alias at specific time. In a subscription query:
select WorkProjectionReportTime,WorkProjectionReportToMailAlias,
'Work Projection Report for the period ' + CONVERT(varchar(10),GETDATE()-31,101)+ ' to '+CONVERT(varchar(10),GETDATE()-1,101) as Subject,
CONVERT(varchar(10),GETDATE()-31,101) as FromDate,CONVERT(varchar(10),GETDATE()-1,101) as ToDate, 60 as WO,
'Please see the attachment for the details' as body
from tblConfig
Pivot ( MAX(cValue) for cKey in (WorkProjectionReportTime,WorkProjectionReportToMailAlias) ) as xyz
So by query I get all the required fields, Email To, Time, report parameters.
I want to use the time parameter to schedule report. e.g. if time is 9:30 the report should be mailed at 9:30 AM etc. I want to achieve this from SQL or database front and not from C#. How to achieve this?