Wrox Home  
Search P2P Archive for: Go

  Return to Index  

proasp_howto thread: Too few parameters. Expected =2.


Message #1 by "David Yee" <david@r...> on Wed, 20 Feb 2002 17:08:10 +0800
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "David Yee" <david@r...>
Subject: [proasp_howto] Too few parameters. Expected =2.


I tried using this and it is working
Response.Write DATEPART("yyyy", MonthRS("DatePurchase"))

But this sql string is giving me error.

strSQL = " SELECT DATEPART(m, DatePurchase) AS Month, DATEPART(yyyy,
DatePurchase) AS YEAR " & _
              " FROM TblTransaction "

Microsoft OLE DB Provider for ODBC Drivers (0x80040E10)
[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected =2.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The two parameters you are not providing are m and yyyy.

Look at your first bit of code, and your second, and you will see that you
are using " around the yyyy in the first, and not in the second. Access is
expecting variables called m and yyyy in the second, but you haven't set
these variables to any value:

SELECT
    DATEPART("m", DatePurchase),
    DATEPART("yyyy", DatePurchase)
FROM
    tblTransaction

will work.

Cheers
Ken



  Return to Index