|
-
Sep 2nd, 1999, 07:22 AM
#1
Thread Starter
Member
Hi Guys,
I got this problem with my table as i'm trying to sum up the results of the whole row of records. E.g.
Total
------
4
5
5
5
so the total should be 19. But when i used the following code:
Select SUM(Total) GrandTotal From Table
When i used a MshFlexGrid to view the result
I got this error:
Syntax Error missing operator in query expression 'SUM(Total) GrandTotal From Table
'
Please Help. And can anyone intro me to a site where i can find more help for SQL ?
Thks.
-
Sep 2nd, 1999, 10:26 AM
#2
Member
Hello,
I think it's very easy, yor SQL string is wrong, you wrote this :
'SELECT SUM(Total) GrandTotal From Table'
But if you want to create a calculated field, you must use this sintaxis:
'SELECT SUM(Total) AS GrandTotal From Table'
This 'AS' indicates that the calculated field 'SUM(Total)' is going to be called 'GrandTotal' in the code.
I want to be helpfully for you.
Bye.
-
Sep 2nd, 1999, 11:08 AM
#3
Thread Starter
Member
First of all thanks for your help 
But what i meant to do is to add a new column after the sum up as Grandtotal and not to see the result only as Grandtotal in the table itself.
E.g.
Total GrandTotal
----- ----------
4 19
5
5
5
??? Any solution??? Thks again.
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
|