Results 1 to 3 of 3
  1. #1
    MFS is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2009
    Location
    Ohio
    Posts
    235

    Only view data from two hours ago til now.

    Hello all, June7 helped me with this a few weeks ago but I still seem to be having a few issues with it.
    I'm looking to only review data from two hours ago until now. By saying this if only a few data points came in today and they were only 15 minutes old I would like to see it. With the below code it does not show any data unless I have data up to the two hour requested.
    Also, my time format in the database is HH:mm and my computer is set for hh:mm, this is also causing problems. (Example shows data at 14:00 and 2:00, twelve hours difference from each other. Again only wanting to see previous two hours)


    Basically saying, is there another alternative to June7's code?

    WHERE (((dbo_turntable41.device)=2) AND (([date1] & " " & [timeatcatcher]) Between DateAdd("h",-2,Now()) And Now()));

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,641
    I did some more testing. Apparently not enough just to concatenate the date/time, use CDate() function as well.

    CDate([date1] & " " & [timeatcatcher)
    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.

  3. #3
    MFS is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2009
    Location
    Ohio
    Posts
    235
    Once again, I am so glad you are on this forum. Works perfectly, thanks again June7

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

Similar Threads

  1. Only show data for past 4 hours
    By MFS in forum Queries
    Replies: 7
    Last Post: 02-28-2014, 02:45 PM
  2. Replies: 2
    Last Post: 01-28-2014, 10:13 PM
  3. Replies: 1
    Last Post: 08-08-2012, 01:42 PM
  4. Replies: 4
    Last Post: 08-06-2012, 10:25 AM
  5. Replies: 1
    Last Post: 07-16-2012, 02:10 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