Please help with the following:
First I am not using any aggregate functions!
I am using the following query to populate a report:
SELECT SO_MAIN.STR_NAME, SO_MAIN.STR_NUMBER, SO_MAIN.NSEW, SO_MAIN.SONUM, SO_PE.PE_DATE, SO_PE.PE_TYPE, SO_MAIN1.COMP_DATE, SO_MAIN.REPORTED, SO_MAIN.REP_BY, SO_MAIN.REQ_BY, SO_PE.PE_HOURS, SO_PE.ID, SO_MAIN1.JOB_CODE, JOBCODES.DESC
FROM ((SO_MAIN INNER JOIN SO_MAIN1 ON SO_MAIN.SONUM=SO_MAIN1.SONUM) INNER JOIN SO_PE ON SO_MAIN1.SONUM=SO_PE.SONUM) INNER JOIN JOBCODES ON SO_MAIN1.JOB_CODE=JOBCODES.JOB_CODE
WHERE (SO_MAIN1.JOB_CODE) Like '7*' AND (SO_MAIN1.COMP_DATE)<=#11/30/1903# AND (SO_MAIN1.COMP_DATE)>=#11/1/1903#
ORDER BY SO_MAIN.STR_NAME, SO_MAIN.STR_NUMBER, SO_MAIN.NSEW, SO_MAIN.SONUM, SO_PE.PE_DATE, SO_PE.PE_TYPE, SO_MAIN1.COMP_DATE;
I am using a querydef to get the query so that the dates can be input in a text box to be inserted into the SQL WHERE statement.
Then I am attempting to open the report using:
DoCmd.OpenReport "MonthlyActivityReport_Maintenance", acViewPreview, "MonthlyActivity_Maintenance"
I get the error on the field named "SO_MAIN.NSEW" but when I remove this field from the "ORDER BY" statement, I get the same error on the field "SO_PE.PE_DATE". Both fields are in the SELECT part of the SQL statement.
Thanks for the help.
Francis
First I am not using any aggregate functions!
I am using the following query to populate a report:
SELECT SO_MAIN.STR_NAME, SO_MAIN.STR_NUMBER, SO_MAIN.NSEW, SO_MAIN.SONUM, SO_PE.PE_DATE, SO_PE.PE_TYPE, SO_MAIN1.COMP_DATE, SO_MAIN.REPORTED, SO_MAIN.REP_BY, SO_MAIN.REQ_BY, SO_PE.PE_HOURS, SO_PE.ID, SO_MAIN1.JOB_CODE, JOBCODES.DESC
FROM ((SO_MAIN INNER JOIN SO_MAIN1 ON SO_MAIN.SONUM=SO_MAIN1.SONUM) INNER JOIN SO_PE ON SO_MAIN1.SONUM=SO_PE.SONUM) INNER JOIN JOBCODES ON SO_MAIN1.JOB_CODE=JOBCODES.JOB_CODE
WHERE (SO_MAIN1.JOB_CODE) Like '7*' AND (SO_MAIN1.COMP_DATE)<=#11/30/1903# AND (SO_MAIN1.COMP_DATE)>=#11/1/1903#
ORDER BY SO_MAIN.STR_NAME, SO_MAIN.STR_NUMBER, SO_MAIN.NSEW, SO_MAIN.SONUM, SO_PE.PE_DATE, SO_PE.PE_TYPE, SO_MAIN1.COMP_DATE;
I am using a querydef to get the query so that the dates can be input in a text box to be inserted into the SQL WHERE statement.
Then I am attempting to open the report using:
DoCmd.OpenReport "MonthlyActivityReport_Maintenance", acViewPreview, "MonthlyActivity_Maintenance"
I get the error on the field named "SO_MAIN.NSEW" but when I remove this field from the "ORDER BY" statement, I get the same error on the field "SO_PE.PE_DATE". Both fields are in the SELECT part of the SQL statement.
Thanks for the help.
Francis