Results 1 to 2 of 2
  1. #1
    robrich22's Avatar
    robrich22 is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Feb 2013
    Location
    Louisville, KY
    Posts
    41

    Query with Date Variable

    I keep getting type mismatch error with a query



    SELECT * FROM [Log Watch] WHERE [Log Watch].EndDate=" & ReportDate &";

    I am building this query in sql view of the query builder and clicking run to view the results. Keeps telling me type mismatch.

  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,652
    If you're in the design or SQL view of a query, you can't use a VBA variable (you could refer to a public function). If you want this to run from a saved query, simplest is probably to have the date value input on a form and let the query get it from there.
    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. Query with Date Variable
    By robrich22 in forum Queries
    Replies: 2
    Last Post: 02-17-2014, 01:03 PM
  2. Date variable Store
    By drunkenneo in forum Programming
    Replies: 1
    Last Post: 07-01-2013, 05:57 AM
  3. using ADO, assigning a date variable
    By crowegreg in forum Programming
    Replies: 3
    Last Post: 08-23-2011, 12:00 AM
  4. Set date field on subform to date variable
    By laavista in forum Access
    Replies: 4
    Last Post: 06-30-2010, 06:32 PM
  5. set date field on form to date variable
    By laavista in forum Access
    Replies: 3
    Last Post: 06-28-2010, 03:03 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