same error message

Results 1 to 3 of 3

Thread: same error message

  1. #1
    Join Date
    Dec 1969

    Default same error message

    I am still getting the same error <BR><BR>Microsoft OLE DB Provider for ODBC Drivers error &#039 80004005&#039 <BR>[IBM][Client Access ODBC Driver (32-bit)][DB2/400 SQL]SQL0401 - Comparison operator = operands not compatible. <BR><BR>/region.asp, line 70<BR><BR>***line 70 is this line:<BR>Set DSData = oSales.Execute(oQuery)<BR><BR>***here is the code<BR><BR>oQuery = "SELECT S6REGN, S6SRP3, S6AN8, S6BLYR, SUM(S6P1$)as SUMS6P1, SUM(S6P2$)as SUMS6P2, SUM(S6P3$)as SUMS6P3, SUM(S6P1U)as SUMS6U1, SUM(S6P2U)as SUMS6U2, SUM(S6P3U)as SUMS6U3 FROM DBIPRDOBJ.SAWKL625 WHERE S6REGN = &#039" &_<BR>Request.Form("reg") & "&#039" &_<BR>" and S6SRP3 = &#039"& Request.Form("class") & "&#039" &_<BR>" and S6AN8 = &#039" Request.Form("cust") & "&#039" &_<BR>" and S6BLYR BETWEEN 1998 AND 2000 GROUP BY S6BLYR ORDER BY S6BLYR"<BR>Set DSData = oSales.Execute(oQuery)

  2. #2
    Join Date
    Dec 1969

    Default update question

    I changed the &#039as&#039 to quotes as in SUM(S6P1U)"SUMS6U1"<BR>However, I got the same result.

  3. #3
    Mip Guest

    Default RE: same error message

    I find one error in you SQL. Follow this RULE OF THUMB:<BR><BR>If a SELECT clause contains GROUP BY functions and COLUMN-NAMES, then those COLUMN_NAMES MUST APPEAR in a GROUP BY clause.<BR> <BR>Also you use &#039as&#039 is acceptable.<BR><BR>Good Luck<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