Getting the SUM of a Column

Results 1 to 2 of 2

Thread: Getting the SUM of a Column

  1. #1
    R Gibson Guest

    Default Getting the SUM of a Column

    I am return the SUM of a column. I thought the code would look something like this:<BR><BR>&#060;%<BR>Dim Connect, Class<BR>Set Connect = Server.CreateObject("ADODB.Connection")<BR>Connect .Open "DSN=db1"<BR>Set Class = Connect.Execute("SELECT SUM(Column1) FROM table1")<BR>&#037;&#062;<BR>&#060;%=Class&#037;&#0 62;<BR><BR>Here is the error I get:<BR><BR>Response object error &#039ASP 0185 : 8002000e&#039 <BR>Missing Default Property <BR>sum.asp, line 18 <BR>A default property was not found for the object. <BR><BR>Thanks in advance!

  2. #2
    Join Date
    Dec 1969
    Posts
    2,849

    Default RE: Getting the SUM of a Column

    Your SQL is correct, you use of the ADO recordset is not.<BR><BR>&#060;%=Class&#037;&#062;<BR><BR>shoul d be<BR><BR>&#060;%=Class(0)&#037;&#062;<BR><BR>See http://www.4guysfromrolla.com/webtech/faq/Databases/faq4.shtml for a good article on ADO recordsets. Happy Programming!

Posting Permissions

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