Results 1 to 2 of 2

Thread: Need to do an aspdb presentation of it's capabilities but .....

  1. #1
    Frustrated Guest

    Need to do an aspdb presentation of it's capabilities but .....

    Error message: Error # (do_Aggregate) = 80040E07(-2147217913)
    Description = [Microsoft][ODBC SQL Server Driver][SQL Server]The sum or average aggregate operation cannot take a char data type as an argument.
    Source = Microsoft OLE DB Provider for ODBC Drivers
    SQL State = 22005
    Native Error = 409
    __________________________________________
    Here is my code. What's the problem?

    <HTML>
    <HEAD><TITLE>Test Page</TITLE></HEAD>
    <BODY BGColor=#e0e0e0>

    <%
    Set Mydb=Server.CreateObject(&#34;ASP.db&#34
    Mydb.dbUnit = 2004
    Mydb.dbDSN = &#34;SQL&#34;
    Mydb.dbSQL = &#34;Select OrderNumber,Description,UnitPrice,LinePrice From dbo.Promis_Data&#34;
    Mydb.dbMode = &#34;Grid&#34;
    Mydb.dbColor = &#34;White,Black,Silver,Black&#34;
    Mydb.dbDBType = &#34;SQL&#34;
    Mydb.dbGridInc = 5

    Mydb.dbGridTableTag = &#34;Border=3&#34;
    Mydb.dbMagicCell = &#34;3,bgcolor=pink align=right,format=[currency];&#34;

    Mydb.dbAggSQL=&#34;SELECT sum(LinePrice) FROM dbo.Promis_Data&#34;
    Mydb.dbAggMagicCell=&#34;0,bgcolor=yellow,<B>forma t=[currency]</B>;&#34;

    s = zAggName & &#34;,<B>Total LinePrice (all records)</B>&#34;
    Mydb.dbUserLocalText=s
    Mydb.dbAggNameTag=&#34;ColSPAN=3 align=right&#34;

    Mydb.ASPdb
    %>

    </BODY>
    </HTML>

  2. #2
    Mark Guest

    Need to do an aspdb presentation of it's capabilities but ..... (reply)

    That is the error message that SQL Server gives when you try to take the sum of a text field. It sounds like LinePrice is a text (char) field but you have assumed it is a numeric field. Can you change it to be a numeric field in SQL Server? Only numeric fields can be summed.

    Mark.


    ------------
    Frustrated at 4/12/01 12:03:33 PM

    Error message: Error # (do_Aggregate) = 80040E07(-2147217913)
    Description = [Microsoft][ODBC SQL Server Driver][SQL Server]The sum or average aggregate operation cannot take a char data type as an argument.
    Source = Microsoft OLE DB Provider for ODBC Drivers
    SQL State = 22005
    Native Error = 409
    __________________________________________
    Here is my code. What&#39;s the problem?

    <HTML>
    <HEAD><TITLE>Test Page</TITLE></HEAD>
    <BODY BGColor=#e0e0e0>

    <%
    Set Mydb=Server.CreateObject(&#34;ASP.db&#34
    Mydb.dbUnit = 2004
    Mydb.dbDSN = &#34;SQL&#34;
    Mydb.dbSQL = &#34;Select OrderNumber,Description,UnitPrice,LinePrice From dbo.Promis_Data&#34;
    Mydb.dbMode = &#34;Grid&#34;
    Mydb.dbColor = &#34;White,Black,Silver,Black&#34;
    Mydb.dbDBType = &#34;SQL&#34;
    Mydb.dbGridInc = 5

    Mydb.dbGridTableTag = &#34;Border=3&#34;
    Mydb.dbMagicCell = &#34;3,bgcolor=pink align=right,format=[currency];&#34;

    Mydb.dbAggSQL=&#34;SELECT sum(LinePrice) FROM dbo.Promis_Data&#34;
    Mydb.dbAggMagicCell=&#34;0,bgcolor=yellow,<B>forma t=[currency]</B>;&#34;

    s = zAggName & &#34;,<B>Total LinePrice (all records)</B>&#34;
    Mydb.dbUserLocalText=s
    Mydb.dbAggNameTag=&#34;ColSPAN=3 align=right&#34;

    Mydb.ASPdb
    %>

    </BODY>
    </HTML>

Posting Permissions

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