Results 1 to 5 of 5
  1. #1
    schreibman is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2012
    Posts
    3

    Help with passing a date into a "between" expression


    I have a query with an expression as follows in criteria:


    Between #1/1/2012# And #1/1/2012#

    I want to pass into that expression a value from another table.
    So, I created a table, DateRange, with fields StartDate and EndDate

    Then, I modified my expression as follows:

    Between [DateRange]![StartDate] And [DateRange]![EndDate]

    Which, of course, didn't work, as the expression didn't know which 'row' to use.


    I'm sure there is something very easy I am missing, but I am a raw access novice, so any help is appreciated!

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,544
    Can you post the SQL statement of the query.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  3. #3
    schreibman is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2012
    Posts
    3
    ...

    where (((CallLog.Date_Call_Began) between #1 / 1 / 2012 # and #1 / 1 / 2012 #));

  4. #4
    alansidman's Avatar
    alansidman is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,529
    Look at this video as it may be helpful

    http://www.datapigtechnologies.com/f...earchform.html

    You will need to adapt it for your date needs, but it should get you on the right path.

  5. #5
    schreibman is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2012
    Posts
    3

    Thumbs up Thanks!

    Quote Originally Posted by alansidman View Post
    Look at this video as it may be helpful

    http://www.datapigtechnologies.com/f...earchform.html

    You will need to adapt it for your date needs, but it should get you on the right path.
    Awesome ! What a great resource! Exactly what I needed, and more!

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

Similar Threads

  1. Replies: 4
    Last Post: 03-14-2012, 09:05 AM
  2. "IIf" "AND/OR" Expression Problem
    By SpdRacerX in forum Forms
    Replies: 1
    Last Post: 02-08-2012, 08:52 AM
  3. Passing criteria "NULL" or "IS NOT NULL" to a query
    By SgtSaunders69 in forum Forms
    Replies: 1
    Last Post: 12-24-2011, 02:22 AM
  4. Replies: 13
    Last Post: 12-05-2011, 05:10 AM
  5. Replies: 8
    Last Post: 08-05-2011, 02:55 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