Results 1 to 2 of 2

Thread: DateDiff (2000)

  1. #1
    2 Star Lounger
    Join Date
    Jun 2001
    Location
    Kenton, Delaware, USA
    Posts
    107
    Thanks
    0
    Thanked 0 Times in 0 Posts

    DateDiff (2000)

    I have a form that has several date fields set to short time. I need to do DateDiff in minutes which is ok until I run into the problem of going past 24:00. When I do a DateDiff( 23:50,0:50,n) I get a negative number. The report that uses the answer uses a grouping Min Mav Avg query, so I can't set the report controls to do a (if <0 then add 1440(n) to <timefield>). My question is can I do the if then statement on the build line of the underlying query that is used to group on?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: DateDiff (2000)

    You might use something like
    Time2Modified:IIf([Time2]<[Time1];1;0)+[Time2]
    and then calculate the difference as DateDiff("n",[Time1],[Time2Modified])

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •