Results 1 to 4 of 4
  1. #1
    desk4tbc is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2011
    Posts
    29

    Searching between two dates

    Hello,

    I'm having troubles creating a query to return records between a certain range of dates. Below is my current query.

    Code:
    SELECT DISTINCT CMS.CMSRID, tmpCMS.FDOS
    FROM CMS LEFT JOIN tmpCMS1500 ON CMS.CMSRID = tmpCMS.CMSRID
    WHERE (((tmpCMS.FDOS) Between #1/1/2011# And #10/13/2011#));



    But it returns dates from 2010. What gives?

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Is the FDOS field a DateTime field or a text field?

  3. #3
    desk4tbc is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2011
    Posts
    29
    It's a DateTime field [Edit: I was wrong.]. I've played around with the search parameters (i.e. 04/15/2011-10/13/2011) and that still gives me options outside of the range (i.e. 02/10/2010).

    EDIT: Figured it out. My make table query for the temp table overwrites the field settings and puts it as a standard text field. Can't believe I missed that. Thanks for the direction RG. Btw, is it possible to have a make table query set field settings or would it be better to use a delete and then an append query for a temporary table?
    Last edited by desk4tbc; 10-13-2011 at 04:57 PM. Reason: Punctuation

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    I personally do not use MakeTable queries but just delete all and append if that helps. Glad to hear you got it sorted.

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

Similar Threads

  1. searching Web Forms
    By jonesdwj in forum Programming
    Replies: 0
    Last Post: 07-08-2011, 03:22 PM
  2. display all dates between two dates
    By KenThompson in forum Access
    Replies: 8
    Last Post: 02-23-2011, 01:11 PM
  3. Mixed dates - show only complete dates?
    By weeblesue in forum Queries
    Replies: 3
    Last Post: 10-27-2010, 02:15 PM
  4. Searching Dates
    By knightjp in forum Database Design
    Replies: 2
    Last Post: 08-16-2008, 11:39 PM
  5. Help with Searching Dates
    By rededdie in forum Access
    Replies: 1
    Last Post: 11-02-2007, 08:34 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