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

Need help in creating query

Status
Not open for further replies.

VFP602

Programmer
Jan 23, 2002
41
MP
Hi guys! I'm just new to Access 2000. I need some ideas on how to create this query. Here it goes. It's for a bird-match game. I have tables Bird (contains bird info), Owner (contains owner info) and Entry Details (contails entry info. Entry Details contains Entry ID., Bird No., Owner No., BirdWeight, Date etc. There can never be more than two different birds for 1 entry id. Now, I need to generate a query that will match all those birds with the same bird weight (> or < to 2 of the birdweight to be matched with other bird) but should not have the same entry id. I need to output this to a report or screen. Any idea on this is very much appreciated.
 
the issue i can see here is trying to match all different groups of birds, because of what you want.

So if a birds weight is 10, then you can match down to 8 and up to 12. But when you are matching a birds weight of 14, then you are going to bring in the birds that that weight is 12, and so one.

I hope i read what you wanted correctly, if not let me know.

I think i know a way around it, but I need to make sure exactly what you want to do.
 
Yes, you got it right M8KWR. But once a bird is matched already, you cannot matched it again. You have to skip to the next bird that hasn't been matched yet. Also, if you're matching the bird they cannot have the same owner no. otherwise you also have to skip it and go on to the next bird again.
 
What would happen if you had 2 birds with the weigth of 8 entered from the same person, so you group all the 8 - 12 birds together, but you are left with this single bird, which is not going to be grouped. Are you going to group that bird individually?

I think i have a solution which involves looping queries, are you ok with loops etc. It would have to be a button on a form, thats runs all the queries then loops etc.

You would also either have to create another table, or add a field in one of the existing tables, this would be the birds group, and so that the code know when or not to include this bird in the query.

Hope you are following.
 
If the 2 birds with the same weight from the same person is entered that's fine. If in case there would be a single bird that which is not going to be grouped because it no longer has a match then we just exclude it. Maybe, I'll just prompt user using a form that one bird was exluded or something. I agree in creating another table for the bird's group and another field to identify the 2 birds that are match ..let's say a game no.
 
Can you then elaborate further your idea on this?
 
Still need help on this guys. Whoever has the idea on this, please share it.
 
Sorry, I still here, give me an hour or 2 and I will write something for you to try, and lets see if it will work.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top