Results 1 to 8 of 8
  1. #1
    Join Date
    Feb 2006
    Posts
    12

    Question Unanswered: Access queries - "Now()"

    Hi there, firast post o this forum, hope y'all go easy on me. Heres the problem.......

    I want to select records with a query that fall between a certain date range.... using "Now()" to echo the system date, i want to select all records with the date of "Now()" and two weeks before "Now()"...... any ideas...

    dragon2309

  2. #2
    Join Date
    Aug 2002
    Location
    Melbourne, Australia
    Posts
    111
    In your query put this in the criteria of the date field:

    Code:
    Between Date() And Date()-14
    Regards,



    John A

  3. #3
    Join Date
    Feb 2006
    Posts
    12
    thanks for your reply. i copied and pasted that directly in and it reported that it didnt know what "Date()" was, so i changed Date() to Now() to echo the system date and it works perfectly, can you just tell me, the -14 you put at the end, am i right in thinking that it is subtracting 14 days from the current date, and thus displaying all records with a date between now and 14 days ago.....??

    thanks, dragon2309

    *EDIT* - also, i think i have that problem sorted now, thankyou. but somethign else has risen, slighly away fromt he orignial topic aswell..... here goes

    In a lesson table, all that gets put in there to identify the customer is the customer_ID, this is obviously no good for making mail merge documents on, as you cannot address somebody as "Number 19"!!!! i have the fields there for entry of a customer first and second name, but entering them by hand is open to data validation and verifacation errors. I was wondering if there is any way to use the already present customer_ID to fetch the custoemrs details (first and second name) from the customer_info table..... can ti be done....??


    dragon2309
    Last edited by dragon2309; 02-12-06 at 18:37.

  4. #4
    Join Date
    Aug 2002
    Location
    Melbourne, Australia
    Posts
    111
    Where you put "Between Date() And Date()-14" into you query what is the name of the Field?

    Yes -14 sets a range of to-days date less 14 days.
    Regards,



    John A

  5. #5
    Join Date
    Feb 2006
    Posts
    12
    the name of my date field is lesson_date, but that wouldnt exactly work as it would have to specify a certain date, i want to use the system date (Now()) and select lessons that are 2 weeks previous to this date.

    Ive got it working now so thanks a lot, i was working along with some wierd DateDiff function, but taht was very long and cnonfusing, your one works a treat, so thankyou....!!!

    dragon2309

  6. #6
    Join Date
    Feb 2006
    Posts
    12
    anyone help please, im fairly desperate....

    In a lesson table, all that gets put in there to identify the customer is the customer_ID, this is obviously no good for making mail merge documents on, as you cannot address somebody as "Number 19"!!!! i have the fields there for entry of a customer first and second name, but entering them by hand is open to data validation and verifacation errors. I was wondering if there is any way to use the already present customer_ID to fetch the custoemrs details (first and second name) from the customer_info table..... can ti be done....??

  7. #7
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    suggest you alter the query you use for the mail merge to include the required fields.
    I'd rather be riding on the Tiger 800 or the Norton

  8. #8
    Join Date
    Feb 2006
    Posts
    12
    oh man, i cant believe it was that simple, i completely forgot you could perform queries that spanned tables. Thanks man.

    dragon2309

Posting Permissions

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