I have small table with a structure:
DayRecordID int
InTime_1 datetime
Dept1 int
OutTime_1 datetime
Reason_1 int
InTime_2 datetime
Dept2 int
OutTime_2 datetime
Reason_2 int
InTime_3 datetime
Dept3 int
OutTime_3 datetime
Reason_3 int
InTime_4 datetime
Dept4 int
OutTime_4 datetime
Reason_4 int
InTime_5 datetime
Dept5 int
OutTime_5 datetime
Reason_5 int
InTime_6 datetime
Dept6 int
OutTime_6 datetime
Reason_6 int
I realize this isn't the most ideal Table but before I scrap it and redo, will anyone tell me how to best iterate through the Dept1, Dept2, Dept3, Dept4, Dept5, Dept6 columns and return the VALUES where they are NOT NULL? I don't know if it is the query that is confusing me or the subquery this will be used with.
Thanks!