Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access_asp thread: Search Page - SQL & Access Help


Message #1 by "Sati Bedaysee" <sbedaysee@b...> on Tue, 21 May 2002 22:23:46
Dear All,

I am creating  a search page using UltraDev which searches for archived 
reports from a database. The user can search by: Keyword, Category and Date

The keyword search field is a regular text field, the Category search is a
drop/list menu and the date search are 3 drop/list menus one for day, one
for month and one for year.

The database table for this area consists of: Archive ID, Archive Name,
ArchiveDate, ArchiveLink and Category all of which are of text data types.

I can manage to get the first 2 searches working OK, but am having trouble
with the date search. This is my SQL at the moment:

SELECT DISTINCT ArchiveName, ArchiveLink, Category, ArchiveDate
FROM Archive
WHERE ArchiveName LIKE '%strKeyword%' AND Category LIKE 'strCategory'

Can anyone suggest how to amend my SQL code to allow for a search by date?
Would I need to break the ArchiveDate field in the database into 3 like the
form i.e by day/month/year????

Regards,

Sati.
Message #2 by "Rob Parkhouse" <rparkhouse@o...> on Fri, 24 May 2002 08:00:57
> Dear All,

> I am creating  a search page using UltraDev which searches for archived 
r> eports from a database. The user can search by: Keyword, Category and 
Date

Your database does not need 3 fields for each part of the date. The SQL 
has to format the date in US format (i.e. dd/mm/yyyy) and surround it with 
the # character. As you are already capturing the date on the form in 3 
fields, you can easily format the date in the SQL correctly.  The date 
part of the SQL would be something like:

...... AND ArchiveDate = #" & strMonth & "/" & strDay & "/" & strYear & "#"

Good luck

  Return to Index