c# - Query to see last 6 months records? -
select sum(invoice_amount) invoice_amount, count(*) invoice_count payment_exception pe inner join invoice_details ind on ind.customer_referenceid = pe.id pe.customer_code = '1001012' , ind.status='submit'
select sum(invoice_amount) invoice_amount,count(*) invoice_count payment_exception pe inner join invoice_details ind on ind.customer_referenceid=pe.id pe.customer_code='1001012' , ind.status='submit' , ind.invoice_date>=dateadd(m,-6,getdate()) group invoice_amount
you need add group condition .
Comments
Post a Comment