Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2005
    Posts
    21

    Unanswered: SQL Error Message

    Using the following SQL I am trying to retrieve a certain set of records,
    Code:
    WHERE (((Tbl_INCIDENT.DateReported) Between [Beginning Date] And [Ending Date]) AND ((Tbl_INCIDENT.property) Like "*" & [Enter the Property * for Both] & "*"))
    The very same stuff (using a different table) works just fine, but this one gives me an error message saying the Jet Engine database does not recognize [Enter the Property * for Both] as a valid field name or expression.

    If I got the error for the other query I would understand. But not with it working for one query but not another.



    Jacque

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    try it without an actual asterisk

    one way: [Enter the property, or leave blank for both]
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Sep 2005
    Posts
    21
    Got it! Changed the top line, here's the complete sql;
    Code:
    PARAMETERS [Beginning Date] DateTime, [Ending Date] DateTime, [Enter the Property * for Both] Text ( 255 );
    TRANSFORM Count(Tbl_INCIDENT.TypeofCall) AS CountOfTypeofCall
    SELECT Tbl_INCIDENT.TypeofCall
    FROM Tbl_INCIDENT
    WHERE (((Tbl_INCIDENT.DateReported) Between [Beginning Date] And [Ending Date]) AND ((Tbl_INCIDENT.property) Like "*" & [Enter the Property * for Both] & "*"))
    GROUP BY Tbl_INCIDENT.TypeofCall
    PIVOT Tbl_INCIDENT.TypeofCall;
    jacque
    Last edited by davenportjacque; 11-12-06 at 13:41.

Posting Permissions

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