IF statement help!

phishbfm

Registered User.
Local time
Today, 12:42
Joined
May 26, 2004
Messages
34
Ok,
in a query I have one field for account numbers, one field for sub account numbers, and one field for profile numbers. What I want is if the account number AND the sub account number are the same, then I want to only kick out the highest profile number. How would I go about typing this one out?

Lets say it's set up like this:

sub name acc num profile#
2 @@@@ 12481 2
2 @@@@ 12481 3
1 ****** 38921 1
3 ****** 38921 2


Then, I would want only the second entry of acc num 12481 to show because it's the most up to date profile on that sub, but I would want both entries for acc num 38921 because the profiles are for different subs. does that make sense?
 
Phish,

Try this I think it will solve your problem.

Dylan
 

Attachments

I did this, and im still getting multiple records with the same acc number and same sub that have different profile numbers. does it matter that i have other fields included in the query rather than the three ive mentioned?? do i leave those as "group by" as well????
 
Ok,
I made another query(besides the one im having issues with) and just included the three fields i needed, and i did the "group by". that worked. But im not sure of how to link that query to my other query to get the overall picture worked out. any help?
 

Users who are viewing this thread

Back
Top Bottom