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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Variables 1

Status
Not open for further replies.

Pottsie

Technical User
May 19, 2004
11
AU
G'day all,

Just a quick one for you all.

Is ti possible to, when running a Access 2000 query, to get the user to enter a variable to be used in the query?
Almost like a filter, but not quite if you get my meaning?

An example of what I'd be after would go as follows:
A store manager would like to find out how many people have become members from date 'X' - The question being how do I get X passed to the query using standard SQL, as I'm a hopeless VB programmer.

Thanks in advance

Pottsie
 
How are ya Pottsie . . . .

Your interested in [blue]Parameter Queries[/blue]. Have a look below:



cal.gif
See Ya! . . . . . .
 
In the query window, ask the help for parametized query.

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Pottsie

Look up parameter query.

When defining a query with the query builder, in the criteria section, enter your prompt within square brackets
=[Enter comparison date]
or
>[Enter comparison date]
 
G'day again,

Thanks everyone, your assistance has been invaluable in helping me with this project.
The system I'm working with is missing the help files (Have to speak to someone about that) And I'd forgotten how to use variables.

Thanks, you've been a great help, and I hope to be able to return the favour sometime

Cheers

Pottsie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top