Database Wizrd Problem

C

Chris J

Hi, thanks for reading! I am using Frontpage 2000 Database wizard to set up a search table for my database. It works fine when I set up values like:

Last Name = Last Name or
Insert Name = Insert Name or
Year = Year or
Make = Make or

But I want the user to be able to fill in more then one field! So, by putting 1997 Topps (make) it should show only 1997 Topps cards, etc. I thought maybe setting up like this was the answer, but it did not work as planned:

Lastname = Lastname and
Insert = Insert or (THUS GIVING ME Matches to all with the same lastname and insert name as entered)
Lastname = Lastname and
Make = Make or (THUS GIVING ME matches to all cards with the same Lastname and make)

Continuing with AND AND OR, etc so if one or more fields are filled it works accordingly.

Thanks for help!!!!
 
M

Mike

Use the LIKE operator.

Example:
Lastname LIKE '%::Lastname::%' and Insert LIKE '%::insert::%' and
etc.....

So if you put a last name in and no Insert name it will display all matches
with the last name. Or if you put both is it will display matches that meet
the criteria for both.

Hope This Helps,

Mikeal


Chris J said:
Hi, thanks for reading! I am using Frontpage 2000 Database wizard to set
up a search table for my database. It works fine when I set up values like:
Last Name = Last Name or
Insert Name = Insert Name or
Year = Year or
Make = Make or

But I want the user to be able to fill in more then one field! So, by
putting 1997 Topps (make) it should show only 1997 Topps cards, etc. I
thought maybe setting up like this was the answer, but it did not work as
planned:
Lastname = Lastname and
Insert = Insert or (THUS GIVING ME Matches to all with the same
lastname and insert name as entered)
 
C

Chris J

Hi, thanks for the reply. It did not work. When i put and after each, it requires every field to be filled out. I want it so one field or 2 field , etc can be done and it fine tunes the search according to how many are filled out. Right now I use Like and or so only one field can be done to get it right. Kinda a pain. Please let me know, thanks, CHRIS
 
M

Mike

I must not fully understand your problem....

I understand it as that you have a dbase of trading cards. You want to set
up a search page for users to search the database for a brand, a players
name, etc .....

If this is the case, you would set up a search form with many fields on it.

Field 1 = Name
Field 2 = Brand
Field 2 = Make

Then you need to pass those fields to the dbase query and use the LIKE
operator to narrow your search.

Select * From table_name Where Name LIKE '::%Name%::' and Brand LIKE
'::%Brand%::' and Make LIKE '::%Make::%'

Then the user would enter the following into the search form:

Field 1 = Name
Field 2 =
Field 3 = Make

This would return all matches of Name and Make. Brand was left blank so it
is ignored.

Mikeal

Chris J said:
Hi, thanks for the reply. It did not work. When i put and after each, it
requires every field to be filled out. I want it so one field or 2 field ,
etc can be done and it fine tunes the search according to how many are
filled out. Right now I use Like and or so only one field can be done to
get it right. Kinda a pain. Please let me know, thanks, CHRIS
 
C

Chris J

Exactly, but it does not work when i do it with and, it makes me have to fill out ALL Fields to get the EXACT card. I have it set up as or right now, but only one field can be filled out You can see it at www.CHRISBASEBALLCARDS.com. Thanks again for your time!!!
 
M

Mike

I am doing the exact same thing on my site. Could you please post you exact
query so I can look at it.

Mike


Chris J said:
Exactly, but it does not work when i do it with and, it makes me have to
fill out ALL Fields to get the EXACT card. I have it set up as or right
now, but only one field can be filled out You can see it at
www.CHRISBASEBALLCARDS.com. Thanks again for your time!!!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top