search question

J

Joey Martin

I have an nvarchar field called bathrooms.
These have entries like 2,3,2.5, etc.
It's the decimals that get me.
I want to be able to search for all listings with at least x bathrooms.

If I select all with at least 2 bathrooms, how can I get the ones with
2.5 to show. Is this possible or do I need to reconfigure the field
type?

Thanks
 
B

Bob Lehmann

Why are you using nvarchar for numbers? Use a numeric datatype for the
column.

Bob Lehmann
 
J

Jeff Cochran

I have an nvarchar field called bathrooms.
These have entries like 2,3,2.5, etc.
It's the decimals that get me.
I want to be able to search for all listings with at least x bathrooms.

If I select all with at least 2 bathrooms, how can I get the ones with
2.5 to show. Is this possible or do I need to reconfigure the field
type?

nvarchar isn't the best datatype for a column of number... :)

And yes, change the datatype and do a IF Bathrooms >= 2 THEN in your
search.

Jeff
 
J

Joey Martin

Okay, so I did this. How come my decimals do not show up? I type 1.5 and
only 1 shows...hmmm...
 
B

Bob Barrows [MVP]

You did what? What datatype did you use for the colun\mn? Hopefully not int.

Bob Barrows
 

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

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top