marcoqf
3/29/2019 - 2:15 PM

seleziona i pagamenti effettuati in un arco di tempo

select Invoice_number, payment_0_status, payment_1_status, payment_0_price from tbl_payment WHERE tbl_payment.payment_0_date_paid IS 
NOT null and tbl_payment.payment_0_date_paid BETWEEN '2019-03-10' AND  '2019-03-20'
union
select Invoice_number , payment_0_status, payment_1_status,  payment_1_price from tbl_payment WHERE tbl_payment.payment_1_date_paid IS
NOT null and tbl_payment.payment_1_date_paid BETWEEN '2019-03-10' AND  '2019-03-20'  
ORDER BY `Invoice_number`  DESC


----

select payment_0_price from tbl_payment WHERE tbl_payment.payment_0_date_paid IS NOT null and tbl_payment.payment_0_date_paid > '2019-03-20'
union
select payment_1_price from tbl_payment WHERE tbl_payment.payment_1_date_paid IS NOT null and tbl_payment.payment_1_date_paid > '2019-03-20'