|
-
March 23rd, 2001, 12:13 AM
#1
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 "".
Please help me out. thanks
-
March 23rd, 2001, 08:58 AM
#2
Re: SQL question - thanks
Not sure if this is the problem but when you use a Calculation function in SQL you have to give it a field name. For example...
SELECT SUM(FieldtoSum) as MySum FROM myTable;
Hope this helps
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|