How do I...

Results 1 to 3 of 3

Thread: How do I...

  1. #1
    No one in particular Guest

    Default How do I...

    I need to check for a certain word within a field in a database. What is the correct syntax for this? I thought it was something along the lines of:<BR><BR>&#060;%if rs("Price") = "%tax%" then<BR>....<BR>end if%&#062;<BR><BR>Can anyone help?<BR>

  2. #2
    Join Date
    Dec 1969

    Default But I am very particular!

    You have two things confused.<BR><BR>If you want to check for the word in the DB *before* you get the record(s) [that is, if you only want records where a given field contains that value], then you do something like:<BR><BR>&#060;%<BR>SQL = "SELECT * FROM sometable WHERE Price LIKE &#039%tax%&#039"<BR>Set RS = someDBconnection.Execute( SQL )<BR>%&#062;<BR><BR>But if you want to check the text *after* you&#039ve already gotten the record, you do<BR><BR>&#060;%<BR>If InStr( Price, "txt" ) &#062; 0 Then <BR> &nbsp; ...<BR>End If<BR>%&#062;<BR><BR>

  3. #3
    No one in particular Guest

    Default RE: But I am very particular!

    Aha... guess I&#039m just mixing things up a bit. Thanks!

Posting Permissions

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