<% PageHeader = "" & _ "" & _ "" & _ "" & _ "
" & _ "
" %> <% WhereClause = "" lastname = request("lastname") keywords = request("keywords") PracticeId = request("lstPractice") '######### 'Build Query '######### if PracticeId <> "" then WhereClause = " INNER JOIN Link_A_P ON Attorneys.AttorneyId = Link_A_P.AttorneyId INNER JOIN PracticeAreas ON PracticeAreas.AreaId = Link_A_P.PracticeId WHERE Link_A_P.PracticeId = " & PracticeId sqltext = "SELECT * FROM PracticeAreas WHERE AreaId = " & PracticeId rs.open sqltext,conn if not rs.bof then AreaName = rs("AreaName") end if rs.close SearchData = SearchData & "Practice Area = '" & AreaName & "' " end if if (lastname <> "" and lastname <> "Enter Last Name") then lastname = Replace(lastname, "'", "?") if WhereClause = "" then WhereClause = WhereClause & " WHERE " else WhereClause = WhereClause & " AND " end if WhereClause = WhereClause & " lastname LIKE '" & LastName & "%'" SearchData = "Last Name = '" & lastname & "' " & SearchData end if if (keywords <> "" and keywords <> "Enter Keywords") then keywords = Replace(keywords, "'", "?") if WhereClause = "" then WhereClause = WhereClause & " WHERE (" else WhereClause = WhereClause & " AND (" end if WhereClause = WhereClause & " bio LIKE '%" & keywords & _ "%' or Education LIKE '%" & keywords & _ "%' or Speaking LIKE '%" & keywords & _ "%' or Admitted LIKE '%" & keywords & _ "%' or Memberships LIKE '%" & keywords & "%')" SearchData = "Keywords = '" & Keywords & "' " & SearchData end if Results = "Partners
" & GetAttorney(1,WhereClause) Results = Results & "
Associates
" & GetAttorney(0,WhereClause) 'Results = Results & GetAttorney(2,WhereClause) LawClerks = GetAttorney(3,WhereClause) if LawClerks <> "" then Results = Results & "
Law Clerks
" & LawClerks lastname = "" if Results = "" then Results = "No matches found" Function GetAttorney(Title, Clause) sqltext = "SELECT * FROM Attorneys " & Clause & " WHERE Title = " & Title & " ORDER BY lastname" ' response.write sqltext ' sqltext = "SELECT * FROM Attorneys WHERE lastname = 'Applewhite' ORDER BY lastname" rs.Open sqltext, Conn,2,2 if not rs.bof then Do While not rs.eof theResults = theResults & "" & trim(rs("LastName")) & ", " & trim(rs("FirstName")) & "
" rs.MoveNext Loop end if rs.close 'response.write theresults GetAttorney = theResults end function %> Morris Pickering Law Firm, Litigation Attorneys at Law Attorney List

<%= Results %>