Using SQL To Add Columns to Queries?

Bill Bisco

Custom User Title
Local time
Today, 12:26
Joined
Mar 27, 2009
Messages
92
Dear all,

I am trying to create a clean database and code to generate a report. Your assistance would be much appreciated.

I am trying to count the number of null fields in one of my queries:

screenshot847k.png


However, because of this expression, I cannot carry other fields with it. So the end result looks like:

screenshot848.png


But I would really like it to spit out the following information:

Total Not Fixed: 241
Department: Sustaining Eng

is there a way to create an SQL query to simply add data: I have tried the following:

Code:
ALTER TABLE qrySustainingEngNotFixed2 ADD Dept TEXT(25)
Insert Into qrySustainingEngNotFixed2 (Dept) Values (Sustaining Eng)
SELECT TotalNotFixed, Dept
FROM qrySustainingEngNotFixed2;

The above isn't working. Keep in mind that I want this is just for display purposes. I pondered making a custom table and then making a Union Query, but I'm trying to do this all in one SQL statement.
 
I ended up finding a solution. Unfortunately, it meant that I now have 3 queries.

Code:
SELECT qrySustainingEngNotFixed1.Department, qrySustainingEngNotFixed2.TotalNotFixed
FROM qrySustainingEngNotFixed2, qrySustainingEngNotFixed1
GROUP BY qrySustainingEngNotFixed1.Department, qrySustainingEngNotFixed2.TotalNotFixed;
 

Users who are viewing this thread

Back
Top Bottom