Click to See Complete Forum and Search --> : filtering recordset by price


web123
02-07-2005, 04:22 AM
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

lmf232s
02-07-2005, 11:43 AM
I also order all my recordsets by price asc and the million prices appear first!

This is because you do not have the field set up numeric.
If the field was numeric then 1 would come before 100000 but since
it is not, it really only looks at the first field, so because
of that 1 and 1000000 can show up together.

Lets say you have this
1
10000000
2000000
2
3
30000000

You want it to order like
1
2
3
200000
1000000
30000000
but they are strings and not numeric so they will not sort correctly
and it will display kind of how i did it the first time. Im not for
sure but i think you are going to have to change your datatype or
when you read it out of the DB maybe this will work

If cint(objRS("MyField")) < 250000 then

end if

This way it convert each value to a integer and then only print/display the values that are less then 250000.
Not sure though, give it a try and let me know.

Bullschmidt
02-09-2005, 08:04 AM
And welcome to the board!

How about this:

strSQL = "SELECT * FROM MyTable WHERE CCur(PriceText) <= 250000"