Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2004
    Location
    Maryland
    Posts
    152

    Unanswered: ERROR in SQL QUERY

    Hi,

    I am trying this query with sql server from ACCESS:
    rsOFF.Open "SELECT SUM(ISNULL(OFF_QUANT,0)*ISNULL(OFF_PRICE,0)) AS tot FROM dbo_OFF_ITEM WHERE DB_CONTRACT=" & Form_dbo_AE_CONTRACT1.DB_CONTRACT, CurrentProject.Connection, adOpenDynamic, adLockBatchOptimistic

    but is is giving me this error:
    Wrong number of argument used with function in query expression SUM(ISNULL(OFF_QUANT,0)*ISNULL(OFF_PRICE,0))


    I could not find error.

    can anyone help me.
    mr_roomi

  2. #2
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    Your syntax is fine...

    SELECT SUM(ISNULL(5,0) * ISNULL(NULL, 5)) returns 25.

    Have you tried debugging the final sql statement and running it directly in QA?

  3. #3
    Join Date
    Mar 2004
    Location
    Maryland
    Posts
    152

    Query worked fine with QA but from form error

    HI,

    I this statement works fine wit QA but it is not working from MS ACCESS form.? what is possible reason for that?


    Originally posted by Teddy
    Your syntax is fine...

    SELECT SUM(ISNULL(5,0) * ISNULL(NULL, 5)) returns 25.

    Have you tried debugging the final sql statement and running it directly in QA?
    mr_roomi

  4. #4
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    The only thing I can think of is if you're missing a closing paranthesis in your recordsource. If you cut and pasted directly that doesn't appear to be the problem.

    I guess I'm at a loss if that's not the issue.

    Sorry.


Posting Permissions

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