By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,442 Members | 1,357 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,442 IT Pros & Developers. It's quick & easy.

Help With Query

P: n/a
Hello everyone,

I have the follow data set:

Policy Number Status Date
123 Approved 11/15/2004
123 Received 10/12/2004
123 Paid 1/1/2005
124 Approved 1/5/2005
124 Paid 1/24/2005
124 Received 11/15/2005
125 Received 01/12/2005
125 Approved 01/13/2005
125 Paid 01/24/2005

As you can see, a policy can have multiple records each having a
different status (Received, Approved, Paid, etc)

I need to cycle through these policies and check the following

I need to return the Policies that:

1) All status occurred in 2005 (Paid,Received,Approved)
2) Received record occurred in 2004 but other status happened in 2005
3) Approved record did not occur in 2004

Can this be done in one query? Note that in #3 that if the Approved
record occurred in 2004 - I want to omit that policy all together, not
just the Approved record.


Nov 13 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.