SQL like statment

Results 1 to 2 of 2

Thread: SQL like statment

  1. #1
    Big Al Guest

    Default SQL like statment

    I am havein trouble with my SQL stamne ti have got one that looks like this <BR><BR>SQL = "SELECT subject, date2 FROM press WHERE (((subject) =&#039" & varsubject & "&#039)) OR (((date2) =&#039" & vardate2 & "&#039))"<BR><BR>I know that a like statment can be added but am unser how to. I want the statment to say WHERE (((subject) = Like" & varsubject<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: SQL like statment

    You&#039ve got way too many parentheses here, but here&#039s a quick way to do what you want (assuming you want a total floating search on the subject field):<BR><BR>SQL = "SELECT subject, date2 FROM press WHERE subject like &#039%" & varsubject & "%&#039 OR date2 =&#039" & vardate2 & "&#039"<BR><BR>If you are using Access, change the %&#039s to *&#039s.

Posting Permissions

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