SELECT t.cora_acct_code, t.accountnumber, c.accounttype, t.accountingdate, t.postingamount, t.refer_30, t.control_30, t.control2_30, t.detaildescription
FROM ed.gljedetail_v as t
LEFT JOIN ed.glcoa_v as c
on t.cora_acct_code = c.cora_acct_code
AND t.accountnumber = c.accountnumber
WHERE t.cora_acct_code = 'BMW-A'
AND t.accountingdate <= now()
AND t.accountingdate >= now() - INTERVAL '14 MONTHS'
AND c.accounttype = 'E'
ORDER BY t.accountingdate
- My current code up top. Basically it is taking today or now into account however, I only get partial month of July when I would like it to actually pull the whole 14 months back up till this point. Is there a way to make this work?
- I want the code to recognize the now, but automatically give the full month of the previous months and the month to date of the current month (September)
Also I apologize if my code sucks I am pretty new to this SQL business!!