I'm trying to combine class meeting data for a large set of classes, based upon multi-column logic. For each class nbr (first column) I can have multiple y/n entries corresponding to whether the class meets that day or not. I need to:
Have a single entry for each ClassNbr/DayOfWeek/MtgStart/MtgEnd combination .
I've used Browne's ConcatRelated()
function to great effect to get part of the way there, but I'm stumped with how to get the y/n columns to line up correctly, and I'm stumped on where to go next. This is part of a larger Access 2016 database and needs to stay in it. I'm comfortable using VBA if necessary.
Basic Problem:
Current vs. Expected Real World Result:
You should be able to use aggregation functions:
select col1, min(a) as a, min(b) as b, min(c) as c
from t
group by col1;
Because MS Access stores "Y" as -1 and "N" as 0, MIN()
is equivalent to OR
.
That worked like a charm. Thank you.
Add'l Note for future users:: The data came in a text, so I had to use a series IIF() functions in a query to convert them to the proper numerical value before proceeding as above. e.g:
IIf([a]="Y",-1,0)