Results 1 to 3 of 3
  1. #1
    Davenumber40 is offline Novice
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Aug 2010
    Posts
    1

    Query Looking for Date as Number

    I have a form that a user enters information in, clicks a command button and a query is executed.



    The one field that isn't working is a text field where I'm trying to enter a date. If I put the date in the form I don't get a result but if I put in the number for the date (33384) the query works.

    It seems like the table is storing the date as a pure number but I need to link that to a user's date entry.

    Any help would be greatly appreciated.

  2. #2
    dsmacs is offline Advanced Beginner
    Windows XP Access 2010 (version 14.0)
    Join Date
    Oct 2009
    Location
    Perth Western Australia
    Posts
    52
    In your query add # symbols before and after the date.

  3. #3
    Rawb is offline Expert
    Windows XP Access 2000
    Join Date
    Dec 2009
    Location
    Somewhere
    Posts
    875
    If it's being stored as a Text field, there's your problem. To be able to work with dates effectively, it's best to use the Date/Time fieldtype.

    If you can't change the format of your field though, you can use the DateValue() Function in your Query:

    Code:
    SELECT * FROM MyTable WHERE DateValue([MyTextDateField])=#07/21/2010#
    The above Query will select all Records where the text field MyTextDateField, when converted to a date, equals 07/21/2010.

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

Similar Threads

  1. Number convert to date
    By Argus in forum Programming
    Replies: 1
    Last Post: 08-05-2009, 02:21 PM
  2. how to convert week number to date range
    By qwang1115 in forum Access
    Replies: 1
    Last Post: 02-13-2009, 11:35 AM
  3. Change Date Into Number
    By greenbag in forum Queries
    Replies: 0
    Last Post: 11-14-2008, 04:43 PM
  4. Replies: 5
    Last Post: 02-08-2006, 08:42 PM
  5. date/time number
    By playfuljade in forum Forms
    Replies: 4
    Last Post: 12-19-2005, 12:52 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