<% If Trim(rsProdDetail("prodrelatedBooks1"))

Results 1 to 3 of 3

Thread: <% If Trim(rsProdDetail("prodrelatedBooks1"))

  1. #1
    Kevin Guest

    Default <% If Trim(rsProdDetail("prodrelatedBooks1"))

    SQL 2000<BR>Hi everyone,<BR>I have a table with a field in that contains (as an example) A,B,C,D,E, now<BR>what I am tring to do is have this statement in the above instance pickup on<BR>every field that contains an A.<BR>This does not work:<BR>&#060;% If Trim(rsProdDetail("prodrelatedBooks1")) = "%A_%" Then %&#062;<BR><BR>This works if the field only contains an A &#060;% If<BR>Trim(rsProdDetail("prodrelatedBooks1")) = "A" Then %&#062;<BR><BR>This<BR><BR>&#060;% If Trim(rsProdDetail("prodrelatedBooks1")) LIKE "A" Then %&#062;<BR><BR>gives me an error message "<BR>Microsoft VBScript runtime error &#039;800a0023&#039;<BR>Sub or Function not defined<BR>/Store_Front/detail.asp, line 536"<BR><BR>Any input would be great.<BR><BR>Kindest regards,<BR>Kevin<BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default **CROSSPOST**

    *PLEASE* don&#039;t crosspost, especially in this forum!<BR><BR>Especially with questions that would get answered in minutes in the standard Q&A forum? <BR><BR>

  3. #3
    Join Date
    Dec 1969

    Default then , use CONTAINS

    May be you should use a "contains" in a SQL query or a regular expression to verify a "match" between your variables (this last suggestion may be the easiest to implement)<BR>The use of "contains" requires that your database be indexed (for example this is possible with Microsoft SQL2000) and may need some research on your side too.<BR>Once a database is indexed, it is searcheable with the contains statement pretty much like using a search engine...<BR>This is an exemple of my own Contains statement<BR><BR> "select pfid, dept_id, name from vc30_product_family where contains (long_description,&#039;:1&#039;) or contains (short_description,&#039;:1&#039;) or contains (pfid,&#039;:1&#039;) or contains (name,&#039;:1&#039;) order by dept_id"<BR> <BR>you see the contains...

Posting Permissions

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