on 09-09-2008 8:57 PM
I am using Crystal Reports version 10 and want create a formula which will select records created in the last hour.
Is this possible?
Within the select expert, you have existing formulas/date ranges such as LastFullWeek/LastFullMonth/Last7Days but I need a formula which will select LastFullHour.
The field I am using is {Interaction.Time_Created} which contains records in the HH:MM format.
Thanks in advance
Is this a datetime field or just a time field? Is there a date field that you need to account for as well so that you don't pick records from another date?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This will give you the last 60 minutes from the second the report was run:
{table.datetimefield} in dateadd("h",-1,currentdatetime) to currentdatetime
And if you wanted the last completed hour, then use this:
in dateadd("h",-1,dateadd("n",-minute(currentdatetime),dateadd("s",-second(currentdatetime),currentdatetime))) to_
dateadd("n",-minute(currentdatetime),dateadd("s",-second(currentdatetime),currentdatetime))
The underscore is there by design
User | Count |
---|---|
98 | |
11 | |
11 | |
10 | |
10 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.