Results 1 to 4 of 4
  1. #1
    Star Lounger
    Join Date
    Apr 2005
    Posts
    61
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Data Format (Access 2003)

    I have a table with a field called Date that is a Number format with a size of double.

    I have a form that takes a short date.

    I have a query that takes the short date from the form.

    How can I take the short date from the form, and bring back results from the query if the Date in the table has a different data type and format? Example attached.
    Attached Files Attached Files

  2. #2
    5 Star Lounger
    Join Date
    Aug 2004
    Location
    Connecticut, USA
    Posts
    816
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Data Format (Access 2003)

    The way I work around this issue is to create a hidden text box that converts the date to a number using =format([DateBox,"yyyymmdd")*1 as the control source. I then drive the query off of that hidden information. I've updated your file to illustrate - the txtDummy field is not hidden so you can see what is happening.
    Attached Files Attached Files

  3. #3
    Star Lounger
    Join Date
    Apr 2005
    Posts
    61
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Data Format (Access 2003)

    I tried a bunch of things but that creative way never occurred ot me. This does work. Thanks for the solution.

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

    Re: Data Format (Access 2003)

    Another option is to omit the extra text box and to set the criteria in the query to
    <code>
    Format([Forms]![Form]![DateBox],"yyyymmdd")
    </code>
    The idea is the same as in mbarron's solution, but you don't need the extra text box.

Posting Permissions

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