Results 1 to 2 of 2
  1. #1
    chc is offline Novice
    Windows 7 64bit Access 2003
    Join Date
    Jun 2015
    Posts
    1

    Access Query to look up yesterdays date () and report

    I have used date functions with this to get other working queries however this time I cant seem to get it right. I had it up to asking me for a date and it will return the correct data, however thats not what I want.
    I want it to look up the customers info and email and create the report so I can use that report to send an automated email to that customer the following day.


    ie.. the customer completes a reccord today. tomorrow morning my report runs pulling only the previous days reccords.

    Trouble is the Date () function to get the system date is something I cant seem to get right. I tried with brackets, parameters, etc... no luck errors every time. I think of it like this:
    SELECT Customer.FNAME, Customer.LNAME, Customer.LAST_VISIT, Customer.EMAIL
    FROM Customer
    WHERE Customer.LAST_VISIT= Date()-1

    and it works up until the Date() then errors and gives me "Undefined Function "Date" in expression" error message. What am I doing wrong with this seemingly simple Query?

    I also tried defining the database values as dates, no difference no matter how I changed the query around Date.

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,642
    That should work. My first thought is a reference problem:

    http://www.accessmvp.com/djsteele/Ac...nceErrors.html
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Replies: 1
    Last Post: 07-14-2014, 10:45 PM
  2. Replies: 5
    Last Post: 02-27-2014, 08:25 PM
  3. Replies: 2
    Last Post: 02-20-2014, 09:53 AM
  4. filter date from Query pass down to report
    By geraldk in forum Reports
    Replies: 1
    Last Post: 08-17-2012, 10:14 AM
  5. Replies: 3
    Last Post: 05-21-2010, 03:57 PM

Tags for this Thread

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