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

Access Query question 1

Status
Not open for further replies.

angels2

Technical User
Apr 4, 2004
84
US
I am running a query and have numbers 5555 and 555-h and 555-t how do I run the query for just the 5555 and not the other 2 sets of numbers thanks
 
Set the criteria under the proper field to:
="5555"

BTW:your field is a string, they aren't "numbers".

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Below is a actual set of numbers I am trying to to leave out the one with a -H and -T I did not do a good job of explaining I have probably 500 numbers just like below.


48605-02010
48605-02010-H
48605-02010-T
51031-06900
51031-06900-H
51031-06900-T
 
WHERE yourField Like '*#'

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
I am trying this but when I run the query I get no results. I need to put that statement in the criteria?
 
If all the numbers are the same size ie 11 characters plus possibly -H or -T, then you could use Left(FieldName,11)

Hope this helps.
 
You can create a column like:

Field: CritColumn:Right([YourField],2)

Criteria: Not In ("-H","-T")


Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
In the criteria cell of your number field:
Like '*#'

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
PH,
Very nice solution. I had never used this functionality before.

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top