Question : SQL qyestion

I have this SQL:

Select acct, acct_unit1, trans_date, ref, voucher, from_id, ref_type, dom_amount  From ledger
WHERE     (trans_date >= '01/01/2009') AND (trans_date <= '12/31/2009')

Which works fine but I have additional criteria that needs to be filtered withen that date-range


AND ((acct = '60500') AND (acct_unit1 >= '3000') AND (acct_unit1 <= '3110'))  OR ((acct >= '61000') AND (acct_unit1 >= '3000') AND (acct_unit1 <= '3110')) OR ((acct >= '61000') AND (acct_unit1 >= '4000') AND (acct_unit1 <= '4100'))

Answer : SQL qyestion

Does this work?

~bp
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
SELECT acct,
       acct_unit1,
       trans_date,
       REF,
       voucher,
       from_id,
       ref_type,
       dom_amount
  FROM ledger
 WHERE (trans_date BETWEEN '01/01/2009' AND '12/31/2009')
   AND (((acct =  '60500') AND (acct_unit1 BETWEEN '3000' AND '3110'))
    OR  ((acct >= '61000') AND (acct_unit1 BETWEEN '3000' AND '3110'))
    OR  ((acct >= '61000') AND (acct_unit1 BETWEEN '4000' AND '4100')))
Random Solutions  
 
programming4us programming4us