Help with Range

  • I have following table:

    id low high cost

    1 0.009.994.95

    2 10.0024.995.95

    3 25.0039.997.95

    4 40.0059.998.95

    5 60.0079.999.95

    6 80.0099.9911.45

    I need to query to find cost where low < '10.00' and high > '10.00'. thanks


    </cm>

  • If the fields are not strings

    SELECT cost FROM table

    WHERE low < 10.00 and high > 10.00

    Are the fields strings?

    Then it might be necessary to cast to floats.

    SELECT cost FROM table

    WHERE cast(low as float) < 10.00 and cast(high as float) > 10.00

  • I feel like an idoit. Someone else created this table and i never thought to look at the data types. no wonder the query wasnt working. sorry to bother. thanks


    </cm>

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply