Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2004
    Posts
    1

    Unanswered: 3061-runtime error -pls pls help

    Runtimeerror 3061- Too few parameters expected 1:

    I have a query build like this

    sqlstr = " INSERT INTO [BAI-MAIN] ( [FILE-TYPE],[FILE-SEQUENCE],"
    sqlstr = sqlstr & "[INST-NUMBER], [ACCOUNT-NUMBER], [BRANCH-NUMBER], [DESCRIPTION-CODE] , "
    sqlstr = sqlstr & "[TRAN-DESCRIPTION], [CISM-NAME],[CLASS-CODE],[CURR-PRIN-BALANCE], "
    sqlstr = sqlstr & "[TRAN-AMOUNT],[TRAN-CODE],[TRAN-DATE],[POSTED-DATE],[CHECK-NUMBER],"
    sqlstr = sqlstr & "[REVERSAL-CODE] )SELECT FileType,1,[N601-LASN-INST-NUMBER], "
    sqlstr = sqlstr & "[N602-LASN-ACCOUNT-NUMBER],[N603-LASN-BRANCH-NUMBER], NULL,"
    sqlstr = sqlstr & "IIf(LEFT([LASP-TRANSACTION],1)= '1',Mid([LASP-TRANSACTION],66,80),null) ,"
    sqlstr = sqlstr & "[P022-CISM-NAME],[N504-LASN-CLASS-CODE],[N201-LASN-CURR-PRIN-BALANCE],"
    sqlstr = sqlstr & "[N903-TRAN-AMOUNT],[N902-LAST-TRAN-CODE],[N901-LAST-TRAN-DATE],"
    sqlstr = sqlstr & " IIf(LEFT([LASP-TRANSACTION],1)='1',Mid([LASP-TRANSACTION],89,10),null) "
    sqlstr = sqlstr & " ,NULL,IIf(LEFT([LASP-TRANSACTION],1)='1',Mid([LASP-TRANSACTION],115,1),null) "
    sqlstr = sqlstr & " FROM LoanPullData where cdate(trim(Mid([LASP-TRANSACTION],89,10))) = '" & DateValCheck & "'; "

    MsgBox sqlstr
    CurrentDb.Execute sqlstr, dbFailOnError

    It gives error too few paramterts... pls help somebidyyyyyyy

  2. #2
    Join Date
    Jul 2003
    Location
    Amsterdam, Nederland
    Posts
    450
    I don't know how your db looks and what kind off fields you have but your missing one or two

    Change/test your Insert into to a select statement and youll see where your parameter is missing

    i allso see the following : Mid([LASP-TRANSACTION],89,10),null) "
    sqlstr = sqlstr & " ,NULL,

    the last part is that right ? you wanna insert a null
    just do the following : Mid([LASP-TRANSACTION],89,10),null) "
    sqlstr = sqlstr & " ,,

    so you leave it blank

Posting Permissions

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