I am trying to create a "previous week" filter in the universe to use to schedule a weekly report. I have a datetime field and it's giving me issues.
PSSI3_DM.AGENTACTIVITYLOG.STATUSDATETIME
I thought I could just do something like this.
PSSI3_DM.AGENTACTIVITYLOG.STATUSDATETIME >= dateadd(wk, datediff(wk, 7, getdate()), 0)
and
PSSI3_DM.AGENTACTIVITYLOG.STATUSDATETIME <= dateadd(wk, datediff(wk, 7, getdate()), 6)
or even this....
PSSI3_DM.AGENTACTIVITYLOG.STATUSDATETIME BETWEEN dateadd(wk, datediff(wk, 7, getdate()), 0) AND dateadd(wk, datediff(wk, 7, getdate()), 6)
How do you account for the time?
Previous week would be 11/24/2013 12:00:00 AM to 11/30/2013 11:59:00 PM
PSSI3_DM.AGENTACTIVITYLOG.STATUSDATETIME
I thought I could just do something like this.
PSSI3_DM.AGENTACTIVITYLOG.STATUSDATETIME >= dateadd(wk, datediff(wk, 7, getdate()), 0)
and
PSSI3_DM.AGENTACTIVITYLOG.STATUSDATETIME <= dateadd(wk, datediff(wk, 7, getdate()), 6)
or even this....
PSSI3_DM.AGENTACTIVITYLOG.STATUSDATETIME BETWEEN dateadd(wk, datediff(wk, 7, getdate()), 0) AND dateadd(wk, datediff(wk, 7, getdate()), 6)
How do you account for the time?
Previous week would be 11/24/2013 12:00:00 AM to 11/30/2013 11:59:00 PM