searching various fields

Results 1 to 2 of 2

Thread: searching various fields

  1. #1
    Join Date
    Dec 1969

    Default searching various fields

    Hello,<BR>I have a query which I am searching on 4 different fields. This works well. What I have to do is output just that specific column info in which the search was found in. How do I code that? e.g <BR><BR>strSQLProvider = "SELECT distinct prov_cc, rate_code, cc_des, company, p_geo_lev_2, function, alloc_method, rate, acct, acct_desc, acct_lev_5, acct_lev_6, acct_lev_7, acct_lev_8, cc_lev_1, cc_lev_2, cc_lev_3, cc_lev_4, period "<BR>strSQLProvider = strSQLProvider & " FROM rate_code1 "<BR>strSQLProvider = strSQLProvider & " WHERE "<BR>strSQLProvider = strSQLProvider & " cc_lev_1 LIKE UPPER(&#039" & Form_p_cc_roll & "%&#039)"<BR>strSQLProvider = strSQLProvider & " OR cc_lev_2 LIKE UPPER(&#039" & Form_p_cc_roll & "%&#039)"<BR>strSQLProvider = strSQLProvider & " OR cc_lev_3 LIKE UPPER(&#039" & Form_p_cc_roll & "%&#039)"<BR>strSQLProvider = strSQLProvider & " OR cc_lev_4 LIKE UPPER(&#039" & Form_p_cc_roll & "%&#039)"<BR><BR>If the search was found in cc_lev_4, I want my heading to say...<BR><BR>Prov. CC Lev4<BR>-------------<BR>law<BR>finance<BR>controller<BR><BR>If the search was found on cc_lev_2, I want to have in my table<BR>Prov. CC Lev2<BR>------------<BR>project mgmt<BR>money market<BR>etc.<BR><BR>Thanks in advance

  2. #2
    Join Date
    Dec 1969

    Default RE: searching various fields

    You won&#039t do this in SQL.<BR><BR>You&#039ll have to do some VBScript coding to look at the returned results and see which one was matched.<BR><BR>Or do four separate queries, of course.<BR><BR>

Posting Permissions

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