By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,153 Members | 2,581 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,153 IT Pros & Developers. It's quick & easy.

Query on user inputed date parameters

P: 1
I'm sitting in my IT class and I have two problems. One is easy, the second not so. My first problem is a query I am making. I want to create a query that searches for dvds released between two years, with a pop up box appearing when the query is opened, asking which years to seach between. I have no idea how to do this. I was trying to do
Expand|Select|Wrap|Line Numbers
  1.  Between #[ ]# And #[ ]# 
. but it wouldn't work. What would I have to type as my criteria.

My second problem is with another query. I want to make a query that shows which Users appear a set number of times within a table. For example, Users that appear twice in a table. Is this even possible?

Thanks for your help
Dec 15 '06 #1
Share this Question
Share on Google+
3 Replies


P: 76
For your second question, you would want something like:

Expand|Select|Wrap|Line Numbers
  1. SELECT Table1.User, Count(Table1.User) AS UserCount
  2. FROM Table1
  3. GROUP BY Table1.User
  4. HAVING (((Count(Table1.User))=2));
Dec 15 '06 #2

ADezii
Expert 5K+
P: 8,669
I'm sitting in my IT class and I have two problems. One is easy, the second not so. My first problem is a query I am making. I want to create a query that searches for dvds released between two years, with a pop up box appearing when the query is opened, asking which years to seach between. I have no idea how to do this. I was trying to do
Expand|Select|Wrap|Line Numbers
  1.  Between #[ ]# And #[ ]# 
. but it wouldn't work. What would I have to type as my criteria.

My second problem is with another query. I want to make a query that shows which Users appear a set number of times within a table. For example, Users that appear twice in a table. Is this even possible?

Thanks for your help
'Create a new Query containing the [Release_Date] field and any other Fields
'that you want to see in the result set. In the Criteria Row of the [Release_Date]
'Field type the following line in order to be prompted for a Beginning and
'Ending Release Date, then to havew the proper Recordset returned:
Expand|Select|Wrap|Line Numbers
  1. Between [Enter Beginning Date:] And [Enter Ending Date:]
Dec 15 '06 #3

NeoPa
Expert Mod 15k+
P: 31,616
These two posts do answer both of your questions correctly.
However, if you want an explanation of what does what with dates etc in queries, see (Literal DateTimes and Their Delimiters (#).)
Dec 16 '06 #4

Post your reply

Sign in to post your reply or Sign up for a free account.