Click here to Skip to main content
15,890,973 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
hi,

i want give discount offer for sale if the quantity 2 or its multiplication (2,4,6,8 etc ..) hoe to filter a value with this
my Query is
SQL
SELECT    OFFER_MASTER0001.offer_type,OFFER_MASTER0001.discount,OFFER_DETAILS0001.offer_itemcode, OFFER_DETAILS0001.offer_qty,OFFER_MASTER0001.item_code FROM         OFFER_MASTER0001 LEFT OUTER JOIN OFFER_DETAILS0001 ON OFFER_MASTER0001.offer_no = OFFER_DETAILS0001.offer_no WHERE     (OFFER_MASTER0001.item_code = '0000010') AND (OFFER_MASTER0001.qty = 2) AND  (OFFER_MASTER0001.date_from < '06-Mar-15 11:27:38 AM' AND OFFER_MASTER0001.date_to > '06-Mar-15 11:27:38 AM')


here is quantity = 2 but i need all multiplication amount of the quantity please help me
Posted
Updated 5-Mar-15 19:18pm
v2

1 solution

Try adding a condition like
SQL
WHERE (quantity%2) = 0
 
Share this answer
 
Comments
itsmehaboob 6-Mar-15 1:32am    
tried this but :(
Wendelius 6-Mar-15 5:21am    
What was the problem? The % operator returns the modulo so it should be zero whenever quantity is divisible by 2
itsmehaboob 7-Mar-15 2:14am    
got it i tried like this WHERE (2%quantity) = 0 this is actually i need Tank you Mika

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900