How to Query with User Prompt (1 Viewer)

JGravesNBS

Registered User.
Local time
Today, 13:12
Joined
Apr 5, 2014
Messages
58
I have the following hard coded query that returns all the members that have 25 years of service

Field: Years: DateDiff("yyyy",[17 Init Date],Now())
Criteria: 25

How can I change it so the query will prompt the user to enter the date (Now) I want to calculate to?
 

Minty

AWF VIP
Local time
Today, 21:12
Joined
Jul 26, 2013
Messages
10,371
Simply replace Now() with [Enter Date]
 

CJ_London

Super Moderator
Staff member
Local time
Today, 21:12
Joined
Feb 19, 2013
Messages
16,637
now does not return just a date, it also returns a time.

And to answer your question, the simple answer is

Field: Years: DateDiff("yyyy",[17 Init Date],[Enter Date])

but if the user is not opening the query from the navigation window, it may not work because you can't use parameter queries in many situations
 

Users who are viewing this thread

Top Bottom