|
-
Dec 2nd, 2004, 05:27 AM
#1
Thread Starter
Hyperactive Member
A Query Problem
hello
i have 4 fields
1. category
2. from_price
3. to_price
4. words
this is basically a search query ...i don't know how to query for range like a user need to search like:
category : visual basic
from_price: 10
to_price: 100
words: active x controls
now active x controls should be displayed which are in range from 10 to 100 in the category visual basic. ( i will make the display thing) please help me with query.
thanks!
Tapan Bhanot,
CEO, Avis Software.
Website: www.avissoftware.com
-
Dec 2nd, 2004, 10:36 AM
#2
Frenzied Member
Code:
SELECT * FROM tablexyz WHERE category = 'visual basic' AND range BETWEEN 10 AND 100
Hopefully you don't have 2 fields in the database. Unless you're actually storing ranges, you should only store the price for the item and use the BETWEEN keyword to search for things in a certain range.
-
Dec 2nd, 2004, 12:31 PM
#3
Thread Starter
Hyperactive Member
Hi Ober,
Thanks for the reply. Yes i am only stroring price. Also you did not mention the keywords in the query how do i search for keywords ?
Thanks!
Tapan Bhanot,
CEO, Avis Software.
Website: www.avissoftware.com
-
Dec 2nd, 2004, 02:46 PM
#4
Frenzied Member
Oh, sorry. Forgot that part:
Code:
SELECT * FROM tablexyz WHERE category = 'visual basic' AND range BETWEEN 10 AND 100 AND words LIKE '%active x controls%'
-
Dec 3rd, 2004, 01:19 AM
#5
Thread Starter
Hyperactive Member
Tapan Bhanot,
CEO, Avis Software.
Website: www.avissoftware.com
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|