Joined: 10 Aug 2009
Location: United Kingdom
Online Status: Offline
Posts: 23
Topic: is DateTime in next 24hrs? Posted: 13 Aug 2009 at 1:32am
How do I create a formula which will tell me if a datetime field falls into the next 24 hours at time of running the report or if it falls within the last 24hours?
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Posted: 13 Aug 2009 at 7:10am
given your other post for conditional couting you can use these formulas in the Running Total. If they evaluate to True the record is included in the count.
for in last 24 hours using minutes as you base:
datediff("n",{table.datetimefield},currentdatetime) in 0 to 1440
for in the next 24 hours using minutes as you base:
datediff("n",currentdatetime,{table.datetimefield}) in 0 to 1440
Joined: 10 Aug 2009
Location: United Kingdom
Online Status: Offline
Posts: 23
Posted: 19 Aug 2009 at 4:05am
Thanks, I have used the following then added in a group summary to count and this has worked perfectly. Thanks
if datediff("n",{ITSM_WORKORDERS.WOR_DEADLINE},currentdatetime) in 0 to 1440 then'Last24' else if datediff("n",currentdatetime, {ITSM_WORKORDERS.WOR_DEADLINE}) in 0 to 1440 then'Next24'
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum