New to Queries

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How do I set up a query so that I can pull all of a givin record and no more.
Example - one of the fields is Drawing number. There are several drawing
numbers and numerous lines with the same drawing number. I want to pull up
all of the records for a single drawing number. If that makes sense, please
advise. If it doesnt let me know and I'll try again.

thanks

david
 
under the drawing number field in your query put...

=1234

or whatever the drawing number is. This goes in the criteria.
 
You can also type "DrawingNumber" in the creteria field. When you run
the query, it will ask for "DrawingNumber" and you can just type in the
number you want to see the result for.
Hope this helps.
 
You can also type "DrawingNumber" in the creteria field. When you run
the query, it will ask for "DrawingNumber" and you can just type in the
number you want to see the result for.
Hope this helps.

Actually if you just type "DrawingNumber" (with or without the quotes)
it will search for records containing the exact text string
DrawingNumber - and not prompt you, and not find anything.

Use square brackets - [DrawingNumber] or, better, [Enter drawing
number:] - to make it a parameter query and get a prompt of whatever
text is within the brackets.

John W. Vinson[MVP]
 
John,
I have related question- I need to specify criteria that the users will
enter equipment number in parameter value.
This is what I have for that:
WHERE ((([qryPM's].[Equipment#]) Like [Enter Equipment] & "*"));
The problem is for example: when I’m entering 22, I’m getting 2210, 2200,
2220… How can I specify that query will chose the exact number that entered?
It could be number or letters (in case of letters, I want that they will be
able to enter part of the word as well).
Is it possible?

Thank you for the help.
Anna


John Vinson said:
You can also type "DrawingNumber" in the creteria field. When you run
the query, it will ask for "DrawingNumber" and you can just type in the
number you want to see the result for.
Hope this helps.

Actually if you just type "DrawingNumber" (with or without the quotes)
it will search for records containing the exact text string
DrawingNumber - and not prompt you, and not find anything.

Use square brackets - [DrawingNumber] or, better, [Enter drawing
number:] - to make it a parameter query and get a prompt of whatever
text is within the brackets.

John W. Vinson[MVP]
 
To have an exact match, use

[equipment#] = [Enter equipment]


if you want exact match, UNLESS nothing is found, then, fall back on pattern
match, you can try something like (I haven't tested it) :


WHERE iif( EXISTS ( SELECT * FROM yourTableNameHere WHERE [equipment#] =
[Enter equipment] ),
[equipment#] = [Enter equipment] , [equipment#] LIKE [Enter
equipment] & "*" )





Hoping it may help,
Vanderghast, Access MVP



Anna said:
John,
I have related question- I need to specify criteria that the users will
enter equipment number in parameter value.
This is what I have for that:
WHERE ((([qryPM's].[Equipment#]) Like [Enter Equipment] & "*"));
The problem is for example: when I'm entering 22, I'm getting 2210, 2200,
2220. How can I specify that query will chose the exact number that
entered?
It could be number or letters (in case of letters, I want that they will
be
able to enter part of the word as well).
Is it possible?

Thank you for the help.
Anna


John Vinson said:
You can also type "DrawingNumber" in the creteria field. When you run
the query, it will ask for "DrawingNumber" and you can just type in the
number you want to see the result for.
Hope this helps.

Actually if you just type "DrawingNumber" (with or without the quotes)
it will search for records containing the exact text string
DrawingNumber - and not prompt you, and not find anything.

Use square brackets - [DrawingNumber] or, better, [Enter drawing
number:] - to make it a parameter query and get a prompt of whatever
text is within the brackets.

John W. Vinson[MVP]
 
Back
Top