Kathleen0422
Board Regular
- Joined
- Apr 12, 2006
- Messages
- 188
Good Morning and Happy Monday,
I have an access database with a parameter based query, following is the SQL
PARAMETERS [Date Worked] DateTime;
SELECT tbl_Hours.TMID, tbl_Hours.CostCenter, tbl_Hours.TRC_Code, tbl_Hours.Name, Sum(tbl_Hours.Hours) AS SumOfHours
FROM tbl_Hours
WHERE Date_Worked <= [Date Worked]
GROUP BY tbl_Hours.TMID, tbl_Hours.CostCenter, tbl_Hours.TRC_Code, tbl_Hours.Name
HAVING (((tbl_Hours.TRC_Code)="COMPE" Or (tbl_Hours.TRC_Code)="COMPT" Or (tbl_Hours.TRC_Code)="COMPU" Or (tbl_Hours.TRC_Code)="COMPM"));
Through a macro in Excel I would like to execute this query, but can't seem to do so. I am using the Macro Recorder and it fails stating that I have to few parameters.
Any help would be greatly appreciated.
Thanks,
I have an access database with a parameter based query, following is the SQL
PARAMETERS [Date Worked] DateTime;
SELECT tbl_Hours.TMID, tbl_Hours.CostCenter, tbl_Hours.TRC_Code, tbl_Hours.Name, Sum(tbl_Hours.Hours) AS SumOfHours
FROM tbl_Hours
WHERE Date_Worked <= [Date Worked]
GROUP BY tbl_Hours.TMID, tbl_Hours.CostCenter, tbl_Hours.TRC_Code, tbl_Hours.Name
HAVING (((tbl_Hours.TRC_Code)="COMPE" Or (tbl_Hours.TRC_Code)="COMPT" Or (tbl_Hours.TRC_Code)="COMPU" Or (tbl_Hours.TRC_Code)="COMPM"));
Through a macro in Excel I would like to execute this query, but can't seem to do so. I am using the Macro Recorder and it fails stating that I have to few parameters.
Any help would be greatly appreciated.
Thanks,