Results 1 to 2 of 2
  1. #1
    SpdRacerX is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Jan 2012
    Posts
    40

    Iif Expression in Query from Time Field

    Not sure if this is the correct thread or the General but I'm experiencing the following problem.



    I have created a query where Total Time is calculated.
    I then want a field in the query where if Total Time is > 24 hours then "Yes" and if not "No"

    I have tried this but get #Error as the results:

    Over: IIf([Total Time]>24,"Yes","No")

    I have tried this but found errors myself in the results (for instance it returns "Yes" for an entry that's Total Time = 8:20):

    Over: IIf([Total Time]>"24:00","Yes","No")

    Help would be appreciated. This is one of my finals steps for my database.

  2. #2
    SpdRacerX is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Jan 2012
    Posts
    40
    Total Time is calculated in the query as follows:

    Total Time: DateDiff("n",[Begin],[End])\60 & Format(DateDiff("n",[Begin],[End]) Mod 60,"\:00")

    Is it possible to have the other field say "Yes" or "No" if OVER?

Please reply to this thread with any new information or opinions.

Similar Threads

  1. fuction elapsed time, expression builder
    By zac123 in forum Access
    Replies: 1
    Last Post: 08-05-2011, 02:21 PM
  2. Date/Time Field Query...
    By Coffee in forum Queries
    Replies: 5
    Last Post: 07-05-2011, 11:27 PM
  3. Replies: 7
    Last Post: 05-31-2011, 11:51 AM
  4. Field Expression Help
    By Cined in forum Reports
    Replies: 3
    Last Post: 03-05-2011, 04:30 PM
  5. Field gets data from Expression?
    By Willot in forum Access
    Replies: 3
    Last Post: 12-10-2005, 06:28 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums