sql -- 'compute', i want to use how to ?

Results 1 to 2 of 2

Thread: sql -- 'compute', i want to use how to ?

  1. #1
    anil(akthangudu@yahoo.com Guest

    Default sql -- 'compute', i want to use how to ?

    Hi! i&#039m trying to execute this sql qry "Select * from tablename compute sum(marks)", this was working fine in sql, but in ASP it was not accepting the word "compute". i want the total marks, how to do that. like this avg also i want, can anybody help me how to get it ?<BR>thanks in Advance.

  2. #2
    Join Date
    Dec 1969

    Default RE: sql -- 'compute', i want to use how t

    The COMPUTE statement is a Microsoft SQL server statement and not ANSI compliant. Therefore, your Sql statement that you are parsing is not a valid statement. The reason is that the data that is returned is meant to be relational. Each row relates to something however, the compute statement produces this figure at the end of the data which is not related to anything. <BR><BR>You are probably connecting through ADODB which checks that the syntax is a valid SQL statement.<BR><BR>You can:<BR>1. Try running another query to get the total you want or<BR>2. define a variable and when you cycle through the recordset just add to this total and when you get to the end of the recordset, you will have your desired value.<BR><BR>Hope this helps.<BR><BR>Cheers<BR>Matthew<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts