I need to figure out how to do this in SQL
each record in my table has the following fields:
Date, EnteredBy, 001a, 001b, 002a, 002b,...,065a, 065b.
(yes, that's a LOT of fields - but it's necessary)
Each number (001, 002, etc) corresponds to an employee
The "a" fields have a value of 1-4. The "b" fields have notes about why the a field has been given that value.
What I need is for the query to check a record (by the date that I provide) and return only the fields "a" and "b" fields where the "a" field has a value of 2.
So let's say that 014a, 026a, and 040a all have a value of 2. I want to see the following show up in the query:
date enteredby 014a 014b 026a 026b 040a 040b
Basically, I want to know what employees had a value of 2 and why they had it.
Is this possible in SQL? I'm teaching myself SQL right now, but I have not gotten to anything that tells me how to do this.
Any help will be greatly appreciated. Thank you.
each record in my table has the following fields:
Date, EnteredBy, 001a, 001b, 002a, 002b,...,065a, 065b.
(yes, that's a LOT of fields - but it's necessary)
Each number (001, 002, etc) corresponds to an employee
The "a" fields have a value of 1-4. The "b" fields have notes about why the a field has been given that value.
What I need is for the query to check a record (by the date that I provide) and return only the fields "a" and "b" fields where the "a" field has a value of 2.
So let's say that 014a, 026a, and 040a all have a value of 2. I want to see the following show up in the query:
date enteredby 014a 014b 026a 026b 040a 040b
Basically, I want to know what employees had a value of 2 and why they had it.
Is this possible in SQL? I'm teaching myself SQL right now, but I have not gotten to anything that tells me how to do this.
Any help will be greatly appreciated. Thank you.