P
PeterM
I have a table:
Pain diary
PD_Date
PD_Med_1_Name
PD_Med_1_Dosage
PD_Med_2_Name
PD_Med_2_Dosage
PD_Med_3_Name
PD_Med_3_Dosage
PD_Med_4_Name
PD_Med_4_Dosage
I plan on running 4 insert into queries to populate the table PancreasMeds
I need to sum the dosages of each MedName, so I created the following query
to sum the values for Med 1
INSERT INTO PancreasMeds
SELECT PD_Date AS PD_Date, PD_Med_1_Name AS PD_Med_1_Name,
Sum(PD_Med_1_Dosage) AS [Sum Of PD_Med_1_Dosage]
FROM Pain_Diary
GROUP BY Pain_Diary.PD_Date, Pain_Diary.PD_Med_1_Name;
which works fine.... I need to do this for the other 3 meds so I created
INSERT INTO PancreasMeds
SELECT PD_Date AS PD_Date, PD_Med_2_Name AS PD_Med_2_Name,
Sum(PD_Med_2_Dosage) AS [Sum Of PD_Med_2_Dosage]
FROM Pain_Diary
GROUP BY Pain_Diary.PD_Date, Pain_Diary.PD_Med_2_Name;
and repeated it for the other 2 meds. When I go to run the query above (Med
2) it complains "THE INTO STATEMENT CONTAINS THE FOLLOWING UNKNOWN FIELD
NAME: PD_MED_2_NAME. MAKE SURE YOU HAVE TYPED THE NAME CORRECTLY, AND TRY
THE OPERATION LATER.
I verified that all references are typed correctly. I get the same message
for the queries for Med 3 and Med 4.... What am I doing wrong?
Thank you very much!
Pain diary
PD_Date
PD_Med_1_Name
PD_Med_1_Dosage
PD_Med_2_Name
PD_Med_2_Dosage
PD_Med_3_Name
PD_Med_3_Dosage
PD_Med_4_Name
PD_Med_4_Dosage
I plan on running 4 insert into queries to populate the table PancreasMeds
I need to sum the dosages of each MedName, so I created the following query
to sum the values for Med 1
INSERT INTO PancreasMeds
SELECT PD_Date AS PD_Date, PD_Med_1_Name AS PD_Med_1_Name,
Sum(PD_Med_1_Dosage) AS [Sum Of PD_Med_1_Dosage]
FROM Pain_Diary
GROUP BY Pain_Diary.PD_Date, Pain_Diary.PD_Med_1_Name;
which works fine.... I need to do this for the other 3 meds so I created
INSERT INTO PancreasMeds
SELECT PD_Date AS PD_Date, PD_Med_2_Name AS PD_Med_2_Name,
Sum(PD_Med_2_Dosage) AS [Sum Of PD_Med_2_Dosage]
FROM Pain_Diary
GROUP BY Pain_Diary.PD_Date, Pain_Diary.PD_Med_2_Name;
and repeated it for the other 2 meds. When I go to run the query above (Med
2) it complains "THE INTO STATEMENT CONTAINS THE FOLLOWING UNKNOWN FIELD
NAME: PD_MED_2_NAME. MAKE SURE YOU HAVE TYPED THE NAME CORRECTLY, AND TRY
THE OPERATION LATER.
I verified that all references are typed correctly. I get the same message
for the queries for Med 3 and Med 4.... What am I doing wrong?
Thank you very much!