Why do I keep getting invalid month for the following sql statement:
SELECT max(stat_ind) as stat_ind, count(posstat_id) as REP_COUNTER from sysadm.injfl_fillpos where position_id = ’95’ AND stat_ind in (‘A’,’W’) AND to_date(fill_dte, ‘mm/dd/yyyy’) >= ’05/01/2004′ AND to_date(fill_dte, ‘mm/dd/yyyy’) <= ’05/10/2004′ group by stat_ind
[b]UPDATE
I got this to work, but not getting the right results. Here is my sql:
SELECT max(stat_ind) as stat_ind, count(posstat_id) as REP_COUNTER from sysadm.injfl_fillpos where position_id = ‘1462’ AND stat_ind in (‘A’) AND fill_dte >= to_date(’08/16/2004′, ‘mm/dd/yyyy’) AND fill_dte <= to_date(’08/17/2004′, ‘mm/dd/yyyy’)
my database has the folowwing records:
xxx 08/16/2004
xxxx 08/17/2004
xxxxx 08/17/2004
but my REP_COUNTER is coming back with a value of 1, but it should be 3. Can someone please help me?
Thanks