Hi,
I've got 2 linked SQL tables, linked by an ID number, and am trying to write a query (not very successfully) that will update a series of Y/N flag fields in one table based on values entered in another. The relationship between flag fields table and the values table is one-many as there can be multiple different values per ID.
That probably doesn't make much sense, so I'll give an example...
Values table has
ID Code
1 S01
2 S01
2 S02
3 S02
3 S03
etc
Where S01 = 'ASP', S02='Consultancy', S03='Contract'
I want each code to update the corresponding flag fields in the
flat flag field table
ID ASP CONSULTANCY CONTRACT
1 Y
2 Y Y
3 Y Y
Hopefully, this makes sense. Messed around with IIf statements and SQL but can't get it to work.
Any help appreciated.
cheers,
Alex

I've got 2 linked SQL tables, linked by an ID number, and am trying to write a query (not very successfully) that will update a series of Y/N flag fields in one table based on values entered in another. The relationship between flag fields table and the values table is one-many as there can be multiple different values per ID.
That probably doesn't make much sense, so I'll give an example...
Values table has
ID Code
1 S01
2 S01
2 S02
3 S02
3 S03
etc
Where S01 = 'ASP', S02='Consultancy', S03='Contract'
I want each code to update the corresponding flag fields in the
flat flag field table
ID ASP CONSULTANCY CONTRACT
1 Y
2 Y Y
3 Y Y
Hopefully, this makes sense. Messed around with IIf statements and SQL but can't get it to work.
Any help appreciated.
cheers,
Alex