简体   繁体   中英

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.

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.

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 Time: " + TimeOfDay() …changed to… "Run Time: " + FormatDateTime(Globals!ExecutionTime, DateFormat.LongTime)

The will provide the results you are seeking for printing Execution runtime, instead of the Current time.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM