K
kempo
Guest
Hi - I have a table called TBLDescription and need some help in extracting certain data. These are the fields,
SBN
CHANNEL
TYPE
COUNTRY
DESCRIPTION
These are my options -
CHANNEL = PUBL or HED or ITPE
TYPE = AC-SHORT or AC-LONG or SMP
COUNTRY = GB or UK or US
I need to query this table and pull one unique SBN(Book Number) and 1 unique DESCRIPTION. This is the logic.
IF COUNTRY = "GB" AND CHANNEL = "PUBL" AND TYPE = "AC-SHORT"
THEN DESCRIPTION
**If there is no description then it needs to try and find a combination that does have a description. So the next step would be GB, PUBL, AC-LONG etc.
It is possible for all options to have a description, so in that case the AC-Short takes priority.
Any ideas on how I can accomplish this?
SBN
CHANNEL
TYPE
COUNTRY
DESCRIPTION
These are my options -
CHANNEL = PUBL or HED or ITPE
TYPE = AC-SHORT or AC-LONG or SMP
COUNTRY = GB or UK or US
I need to query this table and pull one unique SBN(Book Number) and 1 unique DESCRIPTION. This is the logic.
IF COUNTRY = "GB" AND CHANNEL = "PUBL" AND TYPE = "AC-SHORT"
THEN DESCRIPTION
**If there is no description then it needs to try and find a combination that does have a description. So the next step would be GB, PUBL, AC-LONG etc.
It is possible for all options to have a description, so in that case the AC-Short takes priority.
Any ideas on how I can accomplish this?