A process change that necessitates the insertion of a new
record in the Activity table for each Unique_ID in the SLTax table
having the following characteristics:
JOIN on SLTax.Unique_ID = Activity.Unique_ID
SLTax Criteria:
Covge_Eff_Dt > '12/31/2008'
Payto code IN ('1216AA', '1772AA')
Payb_status = 'O'
Activity Criteria:
Check_ID = 10
For max.check_date, Is_Present = 0
INSERT a new record in Activity for each Unique_ID meeting the above
criteria:
Check_ID = 10
User_ID = 45
Date = current date
Is_Present = 1
The follwoing query is used to fetch the data but i am not able to retrive it and Insert. the Query is as follows
SELECT dbo.Activity.*
FROM dbo.Activity INNER JOIN
dbo.SLTax ON dbo.Activity.Unique_ID = dbo.SLTax.Unique_ID
WHERE ('Check_Date' IN
(SELECT MAX('Check_Date')
FROM Activity)) AND (dbo.Activity.Check_ID = 10) AND (dbo.Activity.Is_Present = 'o') AND (dbo.SLTax.Cvge_Eff_Dt > CONVERT(DATETIME,
'2008-12-31 00:00:00', 102)) AND (dbo.SLTax.Payto_Cd IN ('1216AA', '17772AA')) AND (dbo.SLTax.Payb_Status = 'o')
can I get help regarding this