0
            cmd = New SqlCommand("INSERT INTO temp_balance ( debit, credit, accname ) SELECT Sum(temp_sheet.debit) AS debit, Sum(temp_sheet.credit) AS credit, IIf (debit < credit ,'loss','profit') AS expr1 FROM temp_sheet group by temp_sheet.debit,temp_sheet.credit ;", con)

there an error i dont know the error incorrect syntax near ' )

2
Contributors
2
Replies
23
Views
1 Year
Discussion Span
Last Post by hhaannyy
0

Can you run the select separately? And same with insert, using test values? Then try the whole sql statement in SSMS. Nothing stands out as obvious error with syntax.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.