search question

Discussion in 'ASP General' started by Joey Martin, Apr 2, 2004.

  1. Joey Martin

    Joey Martin Guest

    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



    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
    Joey Martin, Apr 2, 2004
    #1
    1. Advertising

  2. Joey Martin

    Bob Lehmann Guest

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

    Bob Lehmann

    "Joey Martin" <> wrote in message
    news:...
    > 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
    >
    >
    >
    > *** Sent via Developersdex http://www.developersdex.com ***
    > Don't just participate in USENET...get rewarded for it!
    Bob Lehmann, Apr 2, 2004
    #2
    1. Advertising

  3. Joey Martin

    Jeff Cochran Guest

    On Fri, 02 Apr 2004 11:58:56 -0800, Joey Martin <>
    wrote:

    >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
    Jeff Cochran, Apr 2, 2004
    #3
  4. Joey Martin

    Joey Martin Guest

    Okay, so I did this. How come my decimals do not show up? I type 1.5 and
    only 1 shows...hmmm...
    "Joey Martin" <> wrote in message
    news:...
    > 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
    >
    >
    >
    > *** Sent via Developersdex http://www.developersdex.com ***
    > Don't just participate in USENET...get rewarded for it!
    Joey Martin, Apr 2, 2004
    #4
  5. You did what? What datatype did you use for the colun\mn? Hopefully not int.

    Bob Barrows
    Joey Martin wrote:
    > Okay, so I did this. How come my decimals do not show up? I type 1.5
    > and only 1 shows...hmmm...
    > "Joey Martin" <> wrote in message
    > news:...
    >> 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
    >>
    >>


    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.
    Bob Barrows [MVP], Apr 2, 2004
    #5
  6. Joey Martin

    Joey Martin Guest

    All is fine. I changed it to decimal and it's working now. Thanks!
    "Bob Barrows [MVP]" <> wrote in message
    news:...
    > You did what? What datatype did you use for the colun\mn? Hopefully not

    int.
    >
    > Bob Barrows
    > Joey Martin wrote:
    > > Okay, so I did this. How come my decimals do not show up? I type 1.5
    > > and only 1 shows...hmmm...
    > > "Joey Martin" <> wrote in message
    > > news:...
    > >> 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
    > >>
    > >>

    >
    > --
    > Microsoft MVP -- ASP/ASP.NET
    > Please reply to the newsgroup. The email account listed in my From
    > header is my spam trap, so I don't check it very often. You will get a
    > quicker response by posting to the newsgroup.
    >
    >
    Joey Martin, Apr 3, 2004
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?TGFrc2htaSBOYXJheWFuYW4uUg==?=

    Google search result like site search!! How?

    =?Utf-8?B?TGFrc2htaSBOYXJheWFuYW4uUg==?=, May 5, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    673
    Lucas Tam
    May 6, 2005
  2. Andy
    Replies:
    1
    Views:
    357
    Jack Klein
    Nov 25, 2003
  3. Anand Pillai

    String search vs regexp search

    Anand Pillai, Oct 12, 2003, in forum: Python
    Replies:
    10
    Views:
    593
    Anand Pillai
    Oct 15, 2003
  4. mason66
    Replies:
    0
    Views:
    422
    mason66
    Jul 27, 2006
  5. Abby Lee
    Replies:
    5
    Views:
    400
    Abby Lee
    Aug 2, 2004
Loading...

Share This Page