F
finster26
I am basically trying to transform some data in a table for a report.
Table - tMAINTENANCE
Fields
ST_SEC_ID, LOCATION, TREAT, YEAR
Data
“122â€, "MAIN STâ€, â€CRâ€, “2000â€
“123â€, “PERRY DRâ€, “CRâ€, “2001â€
“124â€, “WERCH DRâ€, “CRâ€, “2003â€
I create several queries:
Query tMaintenance for YEAR = 2000
Date returned: “122â€, “MAIN STâ€, “CRâ€, “2000â€
Similar queries for 2001, 2002, 2003
Then a query for all the records in tMaintenace and with JOINS to each of
the above queries. This query ends up with the data in this form:
ST_SEC_ID, LOCATION, [2000], [2001], [2002], [2003]
“122â€, “MAIN STâ€, CR,â€â€,â€â€,â€â€
“123â€, “PERRY DRâ€, “â€, CR,â€â€,â€â€
“124â€, “WERCH DRâ€, “â€, “â€, “â€, CR
I end up with too many queries when I take it out to 2020. Can this be done
differently and easier?
Table - tMAINTENANCE
Fields
ST_SEC_ID, LOCATION, TREAT, YEAR
Data
“122â€, "MAIN STâ€, â€CRâ€, “2000â€
“123â€, “PERRY DRâ€, “CRâ€, “2001â€
“124â€, “WERCH DRâ€, “CRâ€, “2003â€
I create several queries:
Query tMaintenance for YEAR = 2000
Date returned: “122â€, “MAIN STâ€, “CRâ€, “2000â€
Similar queries for 2001, 2002, 2003
Then a query for all the records in tMaintenace and with JOINS to each of
the above queries. This query ends up with the data in this form:
ST_SEC_ID, LOCATION, [2000], [2001], [2002], [2003]
“122â€, “MAIN STâ€, CR,â€â€,â€â€,â€â€
“123â€, “PERRY DRâ€, “â€, CR,â€â€,â€â€
“124â€, “WERCH DRâ€, “â€, “â€, “â€, CR
I end up with too many queries when I take it out to 2020. Can this be done
differently and easier?