Print Time formula

Can you make it where if the print time(time) was more than 5 hours ago it would say not up to date?
LVL 3
ThomasBallardITAsked:
Who is Participating?
 
James0628Connect With a Mentor Commented:
Instead of the print date/time, how about the data date/time?  If you save the report with data, the data date/time should reflect when the saved data was read.  Then you can compare that to the current date/time.  For example, you could put a formula like the following in the page heading:

if DateDiff ("n", DateTime (DataDate, DataTime), CurrentDateTime) > 300 then
  "Not up to date"

 I used "n" to get the difference in minutes instead of hours to get a more precise result.  If you use "h" for hours, anything from 5 to just under 6 hours would come back as 5 hours.

 James
0
 
mlmccCommented:
I don't think so because it is up to date when you print it.

What are you trying to do?

mlmcc
0
 
ThomasBallardITAuthor Commented:
If I make the report on monday and save it and then open it up on wednesday the info is no longer up to date.  I guess I just have to refresh it?
0
Take Control of Web Hosting For Your Clients

As a web developer or IT admin, successfully managing multiple client accounts can be challenging. In this webinar we will look at the tools provided by Media Temple and Plesk to make managing your clients’ hosting easier.

 
frodomanCommented:
Yes, if you save it then all of the data will be saved as well - including any formula that you might use to compare dates.

The only workaround I can think of is if you return a date field from your stored procedure you could display that date on your report so you'd at least know how old the data is.  It probably isn't an automated solution like you're looking for but it might work for you.

0
 
MIKESoftware Solutions ConsultantCommented:
Can you use a MAX({yourtable.yourfield}) somewhere in the HEADER of the report that will tell you the MAX DATE for the data?

MikeV
0
 
MIKESoftware Solutions ConsultantCommented:
Maximum({yourtable.datefield})


0
 
frodomanCommented:
Mike's solution will work assuming the data always includes the date that the report was run.  Not knowing what you're looking at, I wasn't sure if this would necessarily be the case - if it is, then use his approach.

frodoman
0
 
MIKESoftware Solutions ConsultantCommented:
Thomas,

Just curious did this work? I've seen issue with the DATA DATE field in the past. Let us know.

Thanks
MikeV
0
All Courses

From novice to tech pro — start learning today.