error:sql statement with date

Results 1 to 2 of 2

Thread: error:sql statement with date

  1. #1
    Join Date
    Dec 1969

    Default error:sql statement with date

    I always get an error when i include the date in my sql statement:<BR>[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 2. My sql is:<BR>SqlX = "select * from tblBestSeller, Powerbooks where tblBestSeller.sku=Powerbooks.sku and BookType= &#039Fiction&#039 and StartDate &#060;= # " & Date() & "# and EndDate &#062;= #" & Date() & "#"<BR>Without the dates it works fine but I need to include these inclusive dates because the books featured will only be for a month and there are other books lined-up for the following months. Hope you could help with this! Thanks<BR>

  2. #2
    ed Guest

    Default RE: error:sql statement with date

    Date() returns a date object not a string. I think you need to convert Date() to a string. i.e. CStr(Date())

Posting Permissions

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