Parameter Query

EndersG

Registered User.
Local time
Today, 09:44
Joined
Feb 18, 2000
Messages
84
Is there a way you can place a default value in the box of a parameter query (i.e., current date for a date parameter)? Similar to what you can do with an InputBox.
 
I believe you could use a function suchas:

Nz([YourField],Date())
 
Give the following query a try in Northwind. When prompted to enter a date:
(1) enter 12/1/94 -- the query will return records with that OrderDate only.
(2) Click OK without specifying a date -- the query will return records with OrderDate #3/15/95#, the default date specified in the query SQL.
Code:
SELECT Orders.OrderID, Orders.EmployeeID, Orders.OrderDate
FROM Orders
WHERE (((Orders.OrderDate)=#3/15/1995#) AND
(([enter date]) Is Null)) OR (((Orders.OrderDate)=[enter date]) AND 
(Not ([enter date]) Is Null));
 
Default value for parameter query

raskew,

You are a life-saver!!!!
 
Parameter default values

Although I tried Ian's and his solution is more streamlined. Touche Fornatian!
 

Users who are viewing this thread

Back
Top Bottom