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

query with criteria on two fileds in one table

P: n/a
Help Needed ms access 2000

I have a table where one field is the year end monthr (January,
February,........, December)
and another field is the year end day (1,2,3,........,31)

i want to create a query which gets the month and date and returns all
records where Year end month = user input (eg April) and year end day <=
user input (eg 5)

any ideas

i have do not any knowledge of vba and will be using query in design view

thanks
colm o'brien
Nov 12 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Ok, in your query...
This would be a little nicer for the user if you did a query-by-form
and they could have two text boxes, 1 to pick month, the other to pick
day, but if you want to know more about that -- email me directly for
more info...

BUT, you want to use your existing query, so.........

sounds like you're getting direct user input...

in the criteria field for year's end (to get the month), put this:
[Which Month?] (or what ever you like to see for a prompt message),

and in the criteria field for the day, put this:
<=[Year End Day?]

When the query runs, two input boxes will appear for input: first for
month & then another for day.
[hopefully, the fields in your query are arranged with month before
day, otherwise the prompt for day will appear before month] -- unless
you don't care if that happens...

-Paul

"colmobrien" <co*****@btinternet.com> wrote in message news:<c0**********@sparta.btinternet.com>...
Help Needed ms access 2000

I have a table where one field is the year end monthr (January,
February,........, December)
and another field is the year end day (1,2,3,........,31)

i want to create a query which gets the month and date and returns all
records where Year end month = user input (eg April) and year end day <=
user input (eg 5)

any ideas

i have do not any knowledge of vba and will be using query in design view

thanks
colm o'brien

Nov 12 '05 #2

P: n/a
Paul that is the same as i already had used but in test data i have days as
1, 5 16 but entering 5 on running query still shows all three entries

colm

"PaulT" <pt******@spsu.edu> wrote in message
news:81*************************@posting.google.co m...
Ok, in your query...
This would be a little nicer for the user if you did a query-by-form
and they could have two text boxes, 1 to pick month, the other to pick
day, but if you want to know more about that -- email me directly for
more info...

BUT, you want to use your existing query, so.........

sounds like you're getting direct user input...

in the criteria field for year's end (to get the month), put this:
[Which Month?] (or what ever you like to see for a prompt message),

and in the criteria field for the day, put this:
<=[Year End Day?]

When the query runs, two input boxes will appear for input: first for
month & then another for day.
[hopefully, the fields in your query are arranged with month before
day, otherwise the prompt for day will appear before month] -- unless
you don't care if that happens...

-Paul

"colmobrien" <co*****@btinternet.com> wrote in message

news:<c0**********@sparta.btinternet.com>...
Help Needed ms access 2000

I have a table where one field is the year end monthr (January,
February,........, December)
and another field is the year end day (1,2,3,........,31)

i want to create a query which gets the month and date and returns all
records where Year end month = user input (eg April) and year end day <= user input (eg 5)

any ideas

i have do not any knowledge of vba and will be using query in design view
thanks
colm o'brien

Nov 12 '05 #3

P: n/a
what if you drop the '<=' to just '=' ?

what is the data type of the field for day? is it text, or number?

are you using any other criteria on the line that I'm unaware of?

these are just some other ideas...

-Paul
(p.s. don't worry, somebody may see something I'm missing, perhaps)
"colmobrien" <cobrien(no Spam)@btinternet.com> wrote in message news:<c0**********@titan.btinternet.com>...
Paul that is the same as i already had used but in test data i have days as
1, 5 16 but entering 5 on running query still shows all three entries

colm

"PaulT" <pt******@spsu.edu> wrote in message
news:81*************************@posting.google.co m...
Ok, in your query...
This would be a little nicer for the user if you did a query-by-form
and they could have two text boxes, 1 to pick month, the other to pick
day, but if you want to know more about that -- email me directly for
more info...

BUT, you want to use your existing query, so.........

sounds like you're getting direct user input...

in the criteria field for year's end (to get the month), put this:
[Which Month?] (or what ever you like to see for a prompt message),

and in the criteria field for the day, put this:
<=[Year End Day?]

When the query runs, two input boxes will appear for input: first for
month & then another for day.
[hopefully, the fields in your query are arranged with month before
day, otherwise the prompt for day will appear before month] -- unless
you don't care if that happens...

-Paul

"colmobrien" <co*****@btinternet.com> wrote in message

news:<c0**********@sparta.btinternet.com>...
Help Needed ms access 2000

I have a table where one field is the year end monthr (January,
February,........, December)
and another field is the year end day (1,2,3,........,31)

i want to create a query which gets the month and date and returns all
records where Year end month = user input (eg April) and year end day <= user input (eg 5)

any ideas

i have do not any knowledge of vba and will be using query in design view
thanks
colm o'brien

Nov 12 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.