Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

using criteria makes it ask for a parameter

Status
Not open for further replies.

ironj32

Technical User
Dec 7, 2006
73
US
when i run the query without criteria it'll run it fine without having to enter a parameter. however, when add criteria it makes me enter a parameter. any thoughts?

here is the SQL statement

criteria:

SELECT tblVendorInformation.[VRA Number], tblVendorInformation.[Vendor Name], tblVendorInformation.[US Bank Property Manager], tblVendorInformation.[Contract End Date], DateDiff("d",[TodaysDate],[Contract End Date]) AS DaysTillExpiration, Date() AS TodaysDate
FROM tblVendorInformation
WHERE (((DateDiff("d",[TodaysDate],[Contract End Date]))<=30));


without criteria:

SELECT tblVendorInformation.[VRA Number], tblVendorInformation.[Vendor Name], tblVendorInformation.[US Bank Property Manager], tblVendorInformation.[Contract End Date], DateDiff("d",[TodaysDate],[Contract End Date]) AS DaysTillExpiration, Date() AS TodaysDate
FROM tblVendorInformation;
 
Both should be prompting you for [TodaysDate], as it is not a field in your table.

Try using Date() in its' place, that will always return the current date.

Hope it helps,

Alex

Ignorance of certain subjects is a great part of wisdom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top