Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

ASP.NET Forum


You are currently viewing our ASP.NET Forum as a guest. Please register to participate.
Login



Reply
filtering recordset by price
Old 02-07-2005, 03:50 AM filtering recordset by price
webgurl's Avatar
Skilled Talker

Posts: 70
Location: Australia
Trades: 0
I am not using numeracy formatting in my database so prices are entered such as 350000 etc

I have a recordset on my page where I want to filter the amount to be less than $250,000
but when you view the results, the millions appear as well.

Filter -
price less than entered value of 250000

works perfectly except for the millions being seven digits


I also order all my recordsets by price asc and the million prices appear first!


Thanks
webgurl is offline
Reply With Quote
View Public Profile Visit webgurl's homepage!
 
 
Register now for full access!
Old 02-07-2005, 05:53 AM
D.Viddy's Avatar
Average Talker

Posts: 24
Location: Soldotna, Alaska
Trades: 0
Assuming that your column for price is a numerical datatype, then this should work.

"SELECT * FROM PRODUCTS WHERE P_PRICE <= 250000 ORDER BY P_PRICE DESC;"

PRODUCTS is the table that has your price column in it.
P_PRICE is the column inside the table that stores the price, Must be numerical datatype!!!
__________________
-Dylan Vester
D.Viddy is offline
Reply With Quote
View Public Profile Visit D.Viddy's homepage!
 
Old 02-07-2005, 06:20 PM
webgurl's Avatar
Skilled Talker

Posts: 70
Location: Australia
Trades: 0
SELECT *
FROM for_sale
WHERE Price <=250000
ORDER BY Price DESC

Is what I have an got a mismatch in criteria expression.

I tried changing the database field to number in data type and that worked.

thanks for the help anyway!
webgurl is offline
Reply With Quote
View Public Profile Visit webgurl's homepage!
 
Old 02-07-2005, 06:22 PM
webgurl's Avatar
Skilled Talker

Posts: 70
Location: Australia
Trades: 0
sorry - you said that!
webgurl is offline
Reply With Quote
View Public Profile Visit webgurl's homepage!
 
Old 02-08-2005, 12:57 PM
Average Talker

Posts: 17
Trades: 0
Dim srtPriceRange
strPriceRange = Request.Form("FieldName")

SELECT * FROM for_sale WHERE UnitPrice = " + Replace(strPriceRange, "'", "''") + ""

SELECT * FROM for_sale WHERE UnitPrice < 250000"

The above example should work. Also try using Distinct or Filter
dexterz is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to filtering recordset by price
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.58253 seconds with 12 queries