help with sql statement

Results 1 to 5 of 5

Thread: help with sql statement

  1. #1
    Join Date
    Dec 1969

    Default help with sql statement

    does anyone see anything wrong with the following statement?<BR><BR>SELECT ID, ProjectStatus, ProjectDescription, ProjectOwner, [Date Opened], ProjectDisposition, [Date Closed] FROM Projects WHERE (Status=&#039;Closed&#039; Or Status=&#039;Cancelled&#039;) And ([Date Closed] Between #" & fromDate & "# And #" & toDate & "#) ORDER BY [Date Closed]<BR><BR>Access Database<BR><BR>I keep getting "Too few parameters. Expected 1" and I can&#039;t figure out why. I have checked my code and table names and they all match up. Maybe I&#039;m just not seeing something in the code. Any help is appreciated.

  2. #2
    Join Date
    Dec 1969

    Default RTFFAQs

  3. #3
    the other steve Guest

    Default not date or empty maybe

    I hate it when that happens!<BR><BR>I see nothing, but I&#039;m bad a proofreading.<BR><BR>I find that either I&#039;ve changed a field name the database or I&#039;ve got a spelling error (wrong field name in the query string).<BR><BR>I haven&#039;t used the [Date Opened] syntax. Is that a field name? I assume you use the brackets because of the space. I&#039;d get rid of the space for long term proofing and portability - I&#039;m sure you&#039;ve heard that before.<BR><BR>2 possibilities:<BR><BR>Make sure fromDate is a date type by doing a cdate(fromdate) on it prior to the query string and the same goes for toDate.<BR><BR>Also make sure neither fromDate is empty or toDate is empty or you&#039;ll get the error.<BR><BR>Good luck.

  4. #4
    zain ( the dragon) Guest

    Default error reason

    This mistake nearly always occurs simply due to an extra or missing quotations ..its definitley porb some &#039; or "

  5. #5
    the other steve Guest

    Default projectStatus - Status

    I noticed you&#039;ve got a field called projectStatus and a field called Status...same field by any chance?

Posting Permissions

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