Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2003
    Posts
    123

    Angry Unanswered: Parameters schmamaters

    Can someone tell me why Access thinks there are too few parameters ("expected: 1") in this SQL when it otherwise works fine in the Query Builder window?

    "SELECT FOX_BRKR.I_BRKR_ID As BrokerID, FOX_BRKR.C_COMM_TYP As RateTyp, FOX_BRKR.R_COMM As RateR, FOX_BRKR.R_FEE As FeeR FROM FOX_BRKR WHERE FOX_BRKR.C_ISS_GRP = '" & IssGrp & "' AND FOX_BRKR.F_DFLT = 'Y';"

    Input is the variable IssGrp that is populated from a textbox, and yes it had a value when the code ran.

  2. #2
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    is this a strings / not strings problem.

    C_ISS_GRP = '" & IssGrp & "' AND
    should be OK if C_ISS_GRP is a string.
    but
    FOX_BRKR.F_DFLT = 'Y';"
    worries me - i have never tried it so i don't know if 'Y' works, but
    FOX_BRKR.F_DFLT = True;"
    should work.

    izy
    currently using SS 2008R2

  3. #3
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    FOX_BRKR.F_DFLT = True will not work if it's a VARCHAR(1) field containing the values 'N' and 'Y'

    possibly the variable IssGrp contains a singlequote, thus prematurely ending the string

    also, i just wanted to say...

    BEST. THREAD. SUBJECT. LINE. EVER.
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

Posting Permissions

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