Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 SQL Range Query for product discounts..

Author  Topic 

salblz
Starting Member

3 Posts

Posted - 2009-11-16 : 13:49:31
I'm trying to set up a query to establish price ranges for product discounts and quantity breaks, but I'm having a hard time with the query to check to see if the price range exists.

Example:

Discounts table has two columns(RangeFrom, RangeTo).

Say I have a row that Has a Range From value of "1" and Range To Value of "10".

I'd like to return the result if the RangeFrom=2 and RangeTo=8.

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2009-11-16 : 14:41:34
where 2 between RangeFrom and RangeTo
and 8 between RangeFrom and RangeTo
Go to Top of Page
   

- Advertisement -