Forum Discussion

dmouser's avatar
dmouser
Frequent Visitor
8 years ago
Solved

Using Today () for duration of day

Hello, I have setup a formula to generate a category for completion deadlines based on time and date, relative to today.  However, using Today () in the formula appears to be keying off of today at midnight (mm/dd/yyyy 00:00:00).  Therefore, anything later than midnight today is showing up in the formula category beyond today. 

 

Suspense Category = IF('Main Working List'[Due to Requestor]=TODAY(),"Due Today",if('Main Working List'[Due to Requestor]<NOW(),"Overdue",if('Main Working List'[Due to Requestor]>NOW(),"Due This Week",BLANK())))

 

Here is a picture of my results.  As you can see, items schedule through today are coming up as Due This Week (which is true), but they're also due today.

 

 

 

 

 

 

 

Any ideas?  Do I need to add an additional IF clause that is >=Today()+1 somewhere?

  • Thank you ChrisMendoza Anonymous and Anonymous for your replies.  I think I found another solution.  I modified the formula to read [Due to Requestor].[Date] = Today().  Adding the .[Date] appears to have forced the formula to render the correct results. 

4 Replies

  • dmouser's avatar
    dmouser
    Frequent Visitor

    Thank you ChrisMendoza Anonymous and Anonymous for your replies.  I think I found another solution.  I modified the formula to read [Due to Requestor].[Date] = Today().  Adding the .[Date] appears to have forced the formula to render the correct results. 

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hey dmouser

     

    You can cast both your column and TODAY as dates to do your comparison. See picture:

     

     

    Hope this helps,

    Parker

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi dmouser

       

      Remember that Today () returns datetime value with the time "12:00:00 AM" always. Thats why its not matching any records with time beyond 12 am.  Anonymous solution will work for you.

       

      Thanks

      Raj

  • ChrisMendoza's avatar
    ChrisMendoza
    Icon for Resident Rockstar rankResident Rockstar

    dmouser

     

    If I understood your issue it is because TODAY( ) returns 8/7/2018 12:00:00 AM, correct?

     

    You could try something like:

     

    Column = DATE(YEAR(TODAY()),MONTH(TODAY()),DAY(TODAY()))&" "&TIME(23,59,59)

    Then change the Data type to Date/Time and it should return 8/7/2018 11:59:59 PM.