johnwiseman
MIS
Hi.
I have a Make Table query taking information from one table and making a new table based on the results. This works fine if there are results to make the table from, but if the query returnes no results then I get the message "You are about to Paste "0" records into a new table". Whilst the table structure is there, it has no results. What I need is for this table to create a record and record there is no result. A "0" or anything.
Here is the SQL...
SELECT [tbl Main Input].[Error Code E], Count([tbl Main Input].ID) AS CountOfID INTO [tbl Errors E]
FROM [tbl Main Input]
WHERE ((([tbl Main Input].Date) Between [forms]![frm mi]![startdate] And [forms]![frm mi]![enddate]))
GROUP BY [tbl Main Input].[Error Code E]
HAVING ((([tbl Main Input].[Error Code E])<>0));
I have a Make Table query taking information from one table and making a new table based on the results. This works fine if there are results to make the table from, but if the query returnes no results then I get the message "You are about to Paste "0" records into a new table". Whilst the table structure is there, it has no results. What I need is for this table to create a record and record there is no result. A "0" or anything.
Here is the SQL...
SELECT [tbl Main Input].[Error Code E], Count([tbl Main Input].ID) AS CountOfID INTO [tbl Errors E]
FROM [tbl Main Input]
WHERE ((([tbl Main Input].Date) Between [forms]![frm mi]![startdate] And [forms]![frm mi]![enddate]))
GROUP BY [tbl Main Input].[Error Code E]
HAVING ((([tbl Main Input].[Error Code E])<>0));