Results 1 to 8 of 8
  1. #1
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 8 Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496

    Bring in date and time into one field

    I have two fields - one stamps the date and the other the time (there is also a checkbox which says that these should only be included if true)



    One is a call back date and the other is a call back time

    the call back date needs to be equal to or less than current date

    however

    the call back time needs to be before the current time by 5 minutes and still appear if the date is below current date (some dates might have the time after the current "Time()" )

    how would I write this?

    I tried concatenating the fields into another field but it gives me dates above current date - not working for me

    p.s. Robin Williams died today so I'm sad.

  2. #2
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 8 Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496
    whoops - nevermind

    I think this will solve

    IIf([callbackdate]=Date(),<=DateAdd("n",10,Time()),[callbacktime])

    let me know if I'm correct/wrong.

  3. #3
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,625
    The use of <= makes no sense to me.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  4. #4
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 8 Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496
    Quote Originally Posted by June7 View Post
    The use of <= makes no sense to me.
    less than or equal to current time minus 10 min?

  5. #5
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,625
    Where are you using this expression? As criteria in a query? Okay, that makes more sense.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  6. #6
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 8 Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496
    query

    I use it to make a form that lists records within the criteria. If one falls under then the form pops up and they can see it is someone they have to call 2-5 min before the time as a reminder.

    I use this on their switchboard timer (I make it pass 10 seconds every time the timer = 1000 using a public variable)

    Basically they get popup reminders of who to call

  7. #7
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 8 Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496
    I'm still working on this - I couldn't get all results to show

    so I'm trying this

    BoolRemove: IIf(([callbackdate]=Date() And [callbacktime]<=Time()) Or (IsNull([callbackdate]) And Not IsNull([callbacktime])),True,False)

    If I can get everything that is either null or before the date to be true then I can only show those (which is what I want)

    however sometimes folks fill both date and time fields and they are before current date.

  8. #8
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 8 Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496
    working formula

    belowtime: IIf(IIf([CallBackDate]<Date() Or IsNull([CallBackDate]),True,False) Or IIf([CallBackDate]=Date() And [CallBackTime]<Time(),True,False)=True,True,False)

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

Similar Threads

  1. Subtracting a date/time field from a number to get date/time
    By Lifeseeker1019 in forum Programming
    Replies: 4
    Last Post: 03-28-2014, 12:59 PM
  2. Replies: 5
    Last Post: 03-19-2014, 02:31 PM
  3. Replies: 8
    Last Post: 09-28-2012, 01:50 PM
  4. Replies: 1
    Last Post: 07-26-2012, 10:20 AM
  5. Getting Just the Date part of Date/Time field
    By GaryElwood in forum Reports
    Replies: 7
    Last Post: 09-28-2011, 09:58 AM

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