"Contains" instead of "Equals"?

Results 1 to 2 of 2

Thread: "Contains" instead of "Equals"?

  1. #1
    Join Date
    Dec 1969

    Default "Contains" instead of "Equals"?

    I have a database that contains different styles for different musicians. However, some musicians fall under more than one style definition. When I want to list all the artists by style, I want an artist that does "adult contemporary" and "easy listening" to show up in both areas in the list. If I list multiple styles per artist in the same database field, is there any way to do this (assuming I have a recordset of rs):<BR><BR>If rs("style") contains "rock"<BR><BR>Instead of this?<BR><BR>If rs("style") = "rock"<BR><BR>I hope this makes sense. I appreciate any help anyone could give me. Thanks!<BR><BR>-eric

  2. #2
    Join Date
    Dec 1969

    Default multiple ways

    You could do it in your select statement:<BR><BR>SELECT * FROM music WHERE style like &#039;%rock%&#039;<BR><BR>Or in VBScript:<BR><BR>If Instr(rs("style"),"rock") &#062; 0 then<BR>...<BR><BR>Peter

Posting Permissions

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