SQL and RegularExpressions

Results 1 to 3 of 3

Thread: SQL and RegularExpressions

  1. #1
    Jeff Kovach Guest

    Default SQL and RegularExpressions

    My ASP Search page criteria is dynamically created using WhereClause&#039s after selecting options from a form page.<BR><BR>"SELECT * FROM [Jobs] WHERE JobType = &#039Contract&#039 AND Skills LIKE &#039%C%&#039 AND InStr(Location,&#039, NH&#039)&#062;0 ORDER BY Date DESC, Title ASC " <BR><BR>In this statement it would bring up every record that has the letter "C" in the "Skills" field of an Access database instead of consultants with the "C" programming language, so I think I need to use regular expressions to control exactly what the user is looking for when they search on single characters. <BR><BR>How do I use regular expressions with an SQL query to build a SQL statement that would eliminate jobs like "Visual Basic" or "Cobol" or any word which has the letter c in it? <BR><BR>Can regular expressions be used with SQL? Is there any articles that could help me? I cannot use the New RegExp object by itself since there is other criteria to search on besides looking in one field.(SQL statement)<BR><BR>Below is the end of code on my ASP Search page: <BR><BR>Query = "SELECT * FROM [Jobs] " & WhereClause & _ <BR>"ORDER BY Date DESC, Title ASC" <BR><BR>Set Jobs = Connect.Execute(Query) <BR><BR>Signed, <BR>Puzzled?

  2. #2
    Join Date
    Dec 1969

    Default RE: SQL and RegularExpressions

    Use "NOT":<BR><BR>Where NOT LIKE &#039Visu%&#039 and NOT LIKE &#039Cob%&#039 etc...<BR><BR>Make Sense?<BR>J.

  3. #3
    Richard A. Lowe Guest

    Default RE: SQL and RegularExpressions

    No, regular expressions are not a part of any SQL implementation I am aware of. Any reg exp work would have to be done on the ASP or component side.<BR><BR>Richard

Posting Permissions

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