Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2004

    Unanswered: Parameter Qry Date Range using mm yyyy

    What I'm playing with . . .
    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
    Provided Answers: 15
    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:
    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