I'd like to count the number of transactions for each debit card and
month over a 3-month period.
But this query --
select DBT_CRD_DIM_NB,
month (tran_dt) as tran_mnth,
count(*) as txns_per_crd_mnth
from cdwdba.VW_DCM_EB_DLY_ALL_TRN_MSR
where tran_dt between '2007-08-01' and '2007-10-31'
group by DBT_CRD_DIM_NB, tran_mnth
-- returns this error:
[IBM][CLI Driver][DB2/AIX64] SQL0206N "TRAN_MNTH" is not valid in the
context where it is used
I haven't used the MONTH() function, before and clearly I must be
using it wrong. Many thanks for any advice.
Paul