Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Other Forums
 MS Access
 search with different results

Author  Topic 

Photoshopgod
Starting Member

10 Posts

Posted - 2004-07-02 : 18:30:59
Hi,

I have a search page on one of my sites that works fine. I would like to modify this to work on another. What I have is a page where someone enters in a name or date and it retreives the info if it is present in the database (access 2000). The code is below:

SearchWhere = request("SearchWhere")
SearchFor = request("SearchFor")

If (SearchWhere = "All") Then
SQL_SearchWhere = "(custGroomLastName LIKE ('%" & SearchFor & "%') OR custGroomFirstName LIKE ('%" & SearchFor & "%') OR custBrideLastName LIKE ('%" & SearchFor & "%') OR custBrideFirstName LIKE ('%" & SearchFor & "%') OR custWedPhotographer LIKE ('%" & SearchFor & "%') OR custWeddingWebsite LIKE ('%" & SearchFor & "%') OR custWeddingDate LIKE ('%" & SearchFor & "%'))"
Else
SQL_SearchWhere = SearchWhere & " LIKE ('%" & SearchFor & "%')"
End If

If NOT (SearchFor = "") Then
SQL_SearchFor = " WHERE " & SQL_SearchWhere
Else
SQL_SearchFor = ""
End If

What I would like to do is when some one enters in a date, it would go out and try to find the date. If it finds no dates that match it displays one message. If it finds 1 date it displays another message. If it finds 2 or more than it displays another message. I realize that the messages will be controlled by an if then statement. What I am trying to figure out is how to modify the code above to search for a date and count the number of records it finds so I can use that number in an if then statement. If this makes no sense please let me know and I'll try to explain it better.

Thanks for any help!

Photoshopgod
Starting Member

10 Posts

Posted - 2004-07-03 : 13:51:04
Forget it. I figured it out. I just needed to walk away from it for a day. I need a vacation!
Go to Top of Page
   

- Advertisement -