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

Check Recordset for 1 of 2 values

Status
Not open for further replies.

SDS100UK

MIS
Jul 15, 2001
185
GB
Hi,

Could anyone tell me the code (or tell me where I might find it) that does the following.

I would like it to check through an Agents 5 or 10 records and if one of the SEGMENT field says SHIFT then to return the value of the DURATION field for the SHIFT. If there is no SHIFT but there is an OT segment then return the value of the DURATION for that OT record. But. . . there may be an OT AND SHIFT in the agents records, so in this case I only want it to return the value of DURATION for the SHIFT.

Then move on to the next agent.

Does this make sense?

I really hope someone can help me with this.

Many thanks in advance

Steven
 
Do you want this to show in a form? This is off the top of my head at lunch and is pretty rough but it might get you started.

Create a query that only selects records when segment = "Shift" or "OT" and sort it in descending order by agent and segment. That way you will have shift records first. Then only process the duration for the first record of each agent and skip the rest in the on current code on your form.

Sorry this is so crude, but I have to get back to work and don't have time to think about it. If you still are having problems, let me know.

Have a great day!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top