Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access_asp thread: Searching database by price problem


Message #1 by mwiens41@m... on Fri, 19 Oct 2001 07:31:01
I am doing a web site for a real estate company and i am having a problem 

with my price search. There is a minimum and a maximum price drop down and 

it brings back results just fine, except for one thing, if people search 

for properties with a price between $150,000 & $200,000 it brings up 

listings in the million dollar range as well. It seems to just match up 

the first number in the searches.



I also have a problem listing records by Price in Ascending order, I think 

this problem is also related to my problem above.



Your help would be greatly appreciated.
Message #2 by "Zee Computer Consulting" <zee@t...> on Fri, 19 Oct 2001 01:06:23 -0700
Is your field a numeric or text field? Is sounds like text, which can cause

comparison problems like those you are experiencing. Convert everything to

numeric (or right-pack your string with spaces or zeroes).





Message #3 by "Charles Mabbott" <aa8vs@m...> on Fri, 19 Oct 2001 04:43:33 -0400
I converted my fields to numberic, ran into very similar things

when field was text........



Chuck



"Do not meddle in the affairs

of Dragons?. Cuz like you

is crunchy and taste good

with catsup."

- Unknown



http://aa8vs.dhs.org:81/aa8vs





Message #4 by "Ken Schaefer" <ken@a...> on Fri, 19 Oct 2001 18:16:52 +1000
Please provide information on how your tables are structured? Do you have

the price stored in a *text* field, or a number field?



Eg,



SELECT field1

FROM tblHouses

WHERE Price BETWEEN 150000 AND 200000



will work properly if Price is a number field. If you are using a text field

you could see the behaviour you are seeing - why? because



1

11

100

1000

10000

2

20



is the correct *alpanumeric* way of sorting a text field in ascending order



Cheers

Ken



Message #5 by "Ken Schaefer" <ken@a...> on Mon, 22 Oct 2001 12:45:31 +1000
OK, can we see some code please?



Cheers

Ken



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

From: "Charles Mabbott" <aa8vs@m...>

Subject: [access_asp] Re: Searching database by price problem





: I converted my fields to numberic, ran into very similar things

: when field was text........

:

: Chuck

:

: >From: "Zee Computer Consulting" <zee@t...>

: >Reply-To: "Access ASP" <access_asp@p...>

: >To: "Access ASP" <access_asp@p...>

: >Subject: [access_asp] Re: Searching database by price problem

: >Date: Fri, 19 Oct 2001 01:06:23 -0700

: >

: >Is your field a numeric or text field? Is sounds like text, which can

cause

: >comparison problems like those you are experiencing. Convert everything

to

: >numeric (or right-pack your string with spaces or zeroes).

: >

: >

: >----- Original Message -----

: >From: <mwiens41@m...>

: >To: "Access ASP" <access_asp@p...>

: >Sent: Friday, October 19, 2001 7:31 AM

: >Subject: [access_asp] Searching database by price problem

: >

: >

: > > I am doing a web site for a real estate company and i am having a

: >problem

: > > with my price search. There is a minimum and a maximum price drop down

: >and

: > > it brings back results just fine, except for one thing, if people

search

: > > for properties with a price between $150,000 & $200,000 it brings up

: > > listings in the million dollar range as well. It seems to just match

up

: > > the first number in the searches.

: > >

: > > I also have a problem listing records by Price in Ascending order, I

: >think

: > > this problem is also related to my problem above.

: > >

: > > Your help would be greatly appreciated.



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~




  Return to Index