I am trying to group by a piece of the date field, this is using SQL in Informix.My query thus far looks like this:select count(*) as Renewals, branchfrom mv_idecal i, cr_newcar nwhere i.id = c.id and renewalmonth between "2009-01-01 00:00:00" and "2009-01-31 23:00:00"group by i.branchorder by i.branch
I would like to not have to run this query for 2 years worth of data for this and similar queries.Is there a way I can use just the year and month for the selection criteria? I think I can cast or convert it and use like or matches, but I'm not sure and I want to be sure it doesnt make any changes to the database.