I have a ODBC query created below:
SELECT pu_balance_hist.account_no, pu_balance_hist.occupant_code, pu_balance_hist.trans_date, pu_balance_hist.jour_code, pu_balance_hist.trans_amt, pu_balance_hist.desc_code, iccpaymc.descript, Month(trans_date)
FROM Northstar_live.harris_live.iccpaymc iccpaymc, Northstar_live.harris_live.pu_balance_hist pu_balance_hist
WHERE iccpaymc.glacct = pu_balance_hist.desc_code AND ((pu_balance_hist.jour_code='CR') AND (pu_balance_hist.trans_date>={ts '2013-01-01 00:00:00'}) AND (iccpaymc.descript<>'Web Credit Card Payment'))
ORDER BY pu_balance_hist.trans_date
I am trying to add if Month(trans_date)=1 then January 2013. I am not sure on how to write that part. I would like to get it from Janaury 2013 to December 2013. Any suggestions?
SELECT pu_balance_hist.account_no, pu_balance_hist.occupant_code, pu_balance_hist.trans_date, pu_balance_hist.jour_code, pu_balance_hist.trans_amt, pu_balance_hist.desc_code, iccpaymc.descript, Month(trans_date)
FROM Northstar_live.harris_live.iccpaymc iccpaymc, Northstar_live.harris_live.pu_balance_hist pu_balance_hist
WHERE iccpaymc.glacct = pu_balance_hist.desc_code AND ((pu_balance_hist.jour_code='CR') AND (pu_balance_hist.trans_date>={ts '2013-01-01 00:00:00'}) AND (iccpaymc.descript<>'Web Credit Card Payment'))
ORDER BY pu_balance_hist.trans_date
I am trying to add if Month(trans_date)=1 then January 2013. I am not sure on how to write that part. I would like to get it from Janaury 2013 to December 2013. Any suggestions?