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

Query?

Status
Not open for further replies.

Jlok

IS-IT--Management
Mar 28, 2002
23
US
I have a table for UPS tracking numbers and could possibly contain 2 or more entries with the same tracking number. Is it possible to write a query that would only show the first instance? I use this field on a crystal form and if it contains multiple tracking numbers it screws up the form. Thanks!
 
If you only want the first instance, I'm assuming there is a date involved. Therefore, you would need a summary query where you would group on UPS tracking number and select the date that is Minimum.

If you want any other options on how to do this, just ask as there is a least one other method.
 
No date involved. Just an order number and tracking number thats it. Sometimes if a package is modified the UPS program will re-write to the table a second time. This is where it is becoming a problem.
 
How do you distinguish the 2 or more entries ?
how do you know which is the first instance ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
This is the problem! The UPS export feature is nice but surely lacking. You don't know which is the first. I dont care which I display in the query just that I only display 1. I dont think what I am asking for is possible but figured I'd ask anyway-
 
Have a look at the DISTINCT predicate.
Another way is to play with an aggregate query.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
DISTINCT worked great! Thanks for the tip!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top