SQL, sum up totals of 3 columns from 3 tables and insert into 1 table with date and timestamp
<p>I have 3 tables that have have incidents, tableA tableB, tableC. I need the total of incidents from tableA.columnA, tableB.columnB, tableC.columnC and inserted into a 3rd table which will accumulate the data over time.</p>

<p>This is what I am trying, the commands complete but the data does not move over.</p>

<pre><code>DECLARE @data INT = 1;
WHILE @data = 1
BEGIN 
IF EXISTS (SELECT * FROM [dbo].[tableA], [dbo].[tableB], [dbo].[tableC])
BEGIN
INSERT INTO [dbo].[sixMonthReport]
SELECT *,  ,GETDATE() AS ImportDate, DATEADD(day, -1, GETDATE()) AS DayofData
FROM [dbo].[tableA], [dbo].[tableB], [dbo].[tableC] 
SET @data = 0
END
ELSE
WAITFOR DELAY '00:00:02'
END
</code></pre>

<p>sixMonthReport table was/is premade with the column names as needed which match up to those column names assigned in their original tables. Is it possible to have these 3 columns calculate their sums, and go into separate columns in the third table with a date/timestamp? (I am aware that it is going to stamp it with the date/time of when the command is ran and also the previous day.)</p>

<p>Here is what the tables look like:</p>

<pre><code>## TableA ##
----------
totalAincidents
14
13
11

## TableB ##
----------
totalBincidents
15
14
15

## TableC ##
----------
totalCindidents
16
15
15

## sixMonthReport ##
-----------
totalAincidents | totalBincidents | totalCincidents | totalIncidents | daterecorded | yesterday's date
-----------
38              | 44 | 46 | 128 | jan 20 | jan 19
</code></pre>

<p>hope this helps</p>