cancel
Showing results for 
Search instead for 
Did you mean: 

INSERT based on values from another table

Former Member
0 Kudos

Hi there

I am attempting to insert data into one table based on data in another but having problems with the syntax.

Any ideas?

Thanks

INSERT INTO A_Nominal(Debit, Type, Ref, Details, Nominal_Code, Item_Date) (SELECT Credit FROM A_Control WHERE C_Description = 'Excess moved to payments on account'), 'JD', 'Transfer', 'Excess moved to payments on account', 1103, '2013-04-12')

WHERE EXISTS

(SELECT Credit FROM A_Control WHERE C_Description = 'Excess moved to payments on account')

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Resolved it...

INSERT INTO A_Nominal(Credit, Type, Ref, Details, Nominal_Code, Item_Date)

SELECT Credit, 'JC', 'Transfer', 'Excess moved from payments on account', '1100', Document_Date FROM A_Sales_Ledger WHERE S_Description = 'Payment on account - from prepayments'

Answers (0)