SSRS 2008 Report Snapshot Timestamp
SSRS 2008 Report Snapshot Timestamp
In SSRS 2005 my report was setup to take snapshot history 5pm daily and it would use the Now() expression to capture the date and time. This would capture the date and time of 5:00 PM and preserve the timestamp in the report.
I upgraded to SQL 2008 (Not R2) and the old reports still hold the snapshot timestamp of 5:00PM, but any newly created reports since the update run the expression each time you look at a snapshot of the shistory. It gives you the time it was ran so if I look at a timestamp for a report captured at 4/1/2013 at 5:00PM today it would display 4/22/2013 10:43AM.
When it was SSRS 2005 if I look at a timestamp for a report captured at 4/1/2013 at 5:00PM today it would display 4/1/2013 at 5:00PM.
2 Answers
2
Faced with the same problem, I ended up adding a datetime column to the dataset and set it to GetDate() in the SQL query. Then I used that field in my report. Not the most elegant solution, but it works.
GetDate()
Sounds like your snapshot isn't getting stored. Yes, I'd try saving the snapshot settings again. Maybe a job has been lost on the SQL server that takes the snapshot...
– Jamie F
Apr 22 '13 at 19:27
Awesome I did get that to work. Thanks
– Ray Clark
Apr 23 '13 at 11:37
In order to grapple with SSRS reports issues with capturing the correct DateTime when running a “report history snapshot” you should use the ExecutionTime global field, as opposed to Now() or Today() type of functions.
--> = "Run Date: " + =Today() …changed to… "Run Date: " + FormatDateTime(Globals!ExecutionTime, DateFormat.ShortDate)
"Run Date: " + =Today()
"Run Date: " + FormatDateTime(Globals!ExecutionTime, DateFormat.ShortDate)
--> = "Run Time: " + TimeOfDay() …changed to… "Run Time: " + FormatDateTime(Globals!ExecutionTime, DateFormat.LongTime)
"Run Time: " + TimeOfDay()
"Run Time: " + FormatDateTime(Globals!ExecutionTime, DateFormat.LongTime)
The will provide the results you are seeking for printing Execution runtime, instead of the Current time.
Required, but never shown
Required, but never shown
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
I actually tried that and it seems like it is still getting the current datetime. Did you have to redo the history settings for it to work? I created a DateTime dataset with this query "Select GetDate() as Now" and this is the expression in the report textbox ="Report for:" + " " + First(Fields!Now.Value, "DateTime").
– Ray Clark
Apr 22 '13 at 18:32