Results 1 to 7 of 7
  1. #1
    keledidi is offline Novice
    Windows XP Access 2003
    Join Date
    Aug 2012
    Posts
    5

    ACCESS DATE/TIME Issue! Thanks!

    Hey guys, I imported some data(tables form in txt files) into access. However, when I am trying to get the data using "create queries" from access, i noticed that some of the data in the tables cannot be extracted using "create queries". Please help me out!



    My SQL command is :

    Select * from MinuteData where ContractID = 461 AND Date = #5/15/2012# AND Time = #9:14:00 AM#

    but if such commands are entered in design view, it became something like

    SELECT MinuteData.ContractID, MinuteData.Date, MinuteData.Time
    FROM MinuteData
    WHERE (((MinuteData.ContractID)=461) AND ((MinuteData.Date)=#5/15/2012#) AND ((MinuteData.Time)=#12/30/1899 9:14:0#));

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,943
    That query is not returning correct records? The Date and Time fields are Date/Time datatype? Try:

    Select * from MinuteData where ContractID = 461 AND [Date] & " " & [Time] As DateTime = #5/15/2012 9:14:00 AM#;
    Last edited by June7; 08-07-2012 at 03:54 AM.
    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
    keledidi is offline Novice
    Windows XP Access 2003
    Join Date
    Aug 2012
    Posts
    5
    Quote Originally Posted by June7 View Post
    That query is not return correct records? The Date and Time fields are Date/Time datatype? Try:

    Select * from MinuteData where ContractID = 461 AND [Date] & " " & [Time] As DateTime = #5/15/2012 9:14:00 AM#;
    Thanks a lot. Let me try it!

  4. #4
    keledidi is offline Novice
    Windows XP Access 2003
    Join Date
    Aug 2012
    Posts
    5
    Quote Originally Posted by June7 View Post
    That query is not return correct records? The Date and Time fields are Date/Time datatype? Try:

    Select * from MinuteData where ContractID = 461 AND [Date] & " " & [Time] As DateTime = #5/15/2012 9:14:00 AM#;
    Doesnt work
    saying some "syntax error" in query expression.

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,943
    I tested both syntax and they work. Must be something about your data. Want to provide db for analysis? Follow instructions at bottom of my post.
    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
    keledidi is offline Novice
    Windows XP Access 2003
    Join Date
    Aug 2012
    Posts
    5
    Quote Originally Posted by June7 View Post
    I tested both syntax and they work. Must be something about your data. Want to provide db for analysis? Follow instructions at bottom of my post.
    Thanks man. I will check it again when i am back to office tomorrow.

  7. #7
    keledidi is offline Novice
    Windows XP Access 2003
    Join Date
    Aug 2012
    Posts
    5
    Quote Originally Posted by June7 View Post
    I tested both syntax and they work. Must be something about your data. Want to provide db for analysis? Follow instructions at bottom of my post.
    It works now! Thanks!

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

Similar Threads

  1. Date/Time Issue
    By bdhFS in forum Access
    Replies: 2
    Last Post: 08-02-2012, 04:22 PM
  2. Access Date and Time Picker
    By jsimard in forum Queries
    Replies: 1
    Last Post: 01-24-2012, 04:04 PM
  3. Date/Time Search Midnight Issue
    By Coffee in forum Queries
    Replies: 5
    Last Post: 07-26-2011, 01:54 AM
  4. Access Date issue
    By janelgirl in forum Programming
    Replies: 7
    Last Post: 03-31-2011, 03:48 PM
  5. access time display issue at liknked table
    By newaccess in forum Access
    Replies: 0
    Last Post: 05-14-2010, 09:24 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