Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2004
    Location
    California
    Posts
    502

    Unanswered: Parameter Qry Date Range using mm yyyy

    What I'm playing with . . .
    Code:
    WHERE ([TblCARETSData.closingdate]>=[ enter START month ] And ([TblCARETSData.closingdate]<=[enter END month] AND ([TblCARETSData.closingdate](yyyy)=[enter YEAR])));
    error . . .
    "Undefined Function '([TblCARETSData.ClosingDate]' in expression"

    This will be a MAKE TABLE query.

    I require many make table queries and am tired of entering >=01/01/2012 and <=03/31/2012, etc.

    Is there a SIMPLE fix for this?

    Thanks . . . Rick

  2. #2
    Join Date
    Mar 2009
    Posts
    5,441
    Provided Answers: 14
    Two things here:

    1. When you use square brackets in a multi-part identifier (Table.Column) each part must be enclosed in them: [Table].[Column], not [Table.Column]

    2. You cannot use Date/Time data types like that. There is a set of functions to manipulate them, perform computations with them and extract parts of them: DatePart(), DateAdd(), DateSerial(), Day(), Month(), Year(), etc.

    You should try something like:
    Code:
    WHERE ( (Month([TblCARETSData].[closingdate])>=[ enter START month ]) And (Month([TblCARETSData].[closingdate])<=[enter END month]) AND  (Year([TblCARETSData].[closingdate])=[enter YEAR]) );
    Have a nice day!

Posting Permissions

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