Quantcast
Channel: dBforums – Everything on Databases, Design, Developers and Administrators
Viewing all articles
Browse latest Browse all 13329

Query Criteria Naming

$
0
0
Hello,

I have a query that uses multiple criteria to filter through a large number of records. Different criteria spit out different records which are then manually analysed.

I would like to be able to tell which criteria a record came from to help me in analysing them.

Is this possible?
I have tried going through using the SQL version of the criteria in an IF statement but that isn't dynamic and with 30 or so criteria it seems quite excessive.

Example attached.
Two lines of criteria.
If we add an extra column to the right (call it 'Detection'), if the order is detected against the first line of criteria, Detection column gets filled with a 1. If it gets detected against the second line the Detection column gets filled with a 2.
Note that there will be some overlap and in those cases I would prefer to have the detection column filled with the first number it matched against.


I hope all of this makes sense and any advice is greatly appreciated.

- Lubos

Attached Images
File Type: jpg Example.JPG (17.9 KB)

Viewing all articles
Browse latest Browse all 13329

Trending Articles