Results 1 to 4 of 4
  1. #1
    cbh35711 is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Feb 2012
    Posts
    40

    Filtering based on form dates

    I have two different versions of a query.


    Code:
    SELECT Approval_status, ModDate AS [Date], borrower, Acct_reference_IDFROM report_log2
    WHERE ModDate Between Forms![Select Dates]!Start_date And Forms![Select Dates]!End_date
    ORDER BY ModDate DESC;
    and

    Code:
    SELECT Approval_status, ModDate AS [Date], borrower, Acct_reference_ID
    FROM report_log2
    WHERE ModDate Between "#" & Forms![Select Dates]!Start_date & "#" And "#" & Forms![Select Dates]!End_date & "#"
    order by ModDate Desc;
    I thought it was filtering correctly, but it appears it is not.

    Any assistance would be greatly appreciated.

    Chris
    Last edited by cbh35711; 03-13-2012 at 11:46 AM.

  2. #2
    cbh35711 is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Feb 2012
    Posts
    40
    Still trying to figure it out.

    When hard coding the dates, i'm getting that the data type mismatch in criteria expression.

    Code:
    WHERE ModDate > "#1-1-2012#" And ModDate < "#1-31-2012#"

    Thanks all

    Chris

  3. #3
    orange's Avatar
    orange is online now Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    What exactly are you trying to do?
    Is ModDate a Date/Time datatype?
    Date is a reserved word in Access.
    You don't need " delimiters on a Date/Time type

  4. #4
    cbh35711 is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Feb 2012
    Posts
    40
    You nailed it Orange. No "". So easy...

    Thanks

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

Similar Threads

  1. Replies: 5
    Last Post: 03-12-2012, 02:58 AM
  2. Filtering Dates Error!
    By emilyrogers in forum Forms
    Replies: 3
    Last Post: 02-15-2011, 03:00 AM
  3. Replies: 13
    Last Post: 09-27-2010, 03:10 PM
  4. Filtering Report with between dates
    By patrickmcdiver in forum Reports
    Replies: 3
    Last Post: 02-22-2010, 12:11 PM
  5. Replies: 0
    Last Post: 07-30-2009, 12:40 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