-
SQL question - thanks
I don't know what is wrong in the following
------------
SELECT @SQL2 = "INSERT INTO #ACETmp " +
"SELECT rptSection = 'A',
Field1 = SummValue,
Field2 = sum(ItemAmount) " +
" FROM vRptbase2
where trantype in ( '33','35') group by SummValue"
execute (SQL2)
--------------------
something wrong with "sum(ItemAmount)". I don't know how to place it correctly. It is how to put "sum(ItemAmount)" within double "".
it works if no ""
---
INSERT INTO #ACETmp
SELECT
rptSection = 'A',
Field1 = SummValue,
Field2 = sum(ItemAmount)
FROM vRptbase2
where trantype in ( '33','35')
group by summvalue
_____
Please help me out. thanks