I am very new to T-SQL coding (so apologies in advance that I couldn't figure this out). I created a new table and I am pulling in column info from two different tables to consolidate it. The 'Select' to the 'From' creates the columns (no data pulled in though, when I use just one table (C1) data is pulled into the columns) and I have used aliases on the tables but I am obviously not setting up the 'Join' statement correctly to be able to pull the data into the new table. I have verified all the tables names, etc. so I am sure it is the way I am writing the script itself. Any help would be appreciated to show me what I am doing incorrectly (using SQL Server 2012):
INSERT INTO view_invfu
SELECT
C1.claimNo AS invfu_history_claimNo,
C2.ClmHistoryId AS invfu_history_id,
CAST(C1.Date AS datetime) + CAST(C1.Time AS datetime) AS invfu_DateTime,
C1.priority AS invfu_priority,
C1.status AS invfu_status,
C1.Date AS invfu_date,
C1.Time AS invfu_time,
C1.assignedById AS invfu_assignedById,
C1.assignedToId AS invfu_assignedtoId,
C1.isactive AS invfu_active,
C2.actionId AS invfu_actionId
FROM
claim_assignedto_history C1, claim_assignedto_historydetail C2
LEFT OUTER JOIN
C2 ON C1.ClaimNo = C2.ClmHistoryId
ORDER BY
1 ASC
Thanks in advance!