Hi guys, any way to count different distincts in one query?
Sub-queries not supported in my MySQL v4.0.??
I have this:
As you can see I'm querying twice, works fine, however I would prefer a way to do it in one query.
Anyone?
Sub-queries not supported in my MySQL v4.0.??
I have this:
Code:
'// Count unique months and years to dimension arrays accordingly
SQL = "SELECT COUNT(DISTINCT Month(Issue)) AS mm FROM tbl_Newsletters WHERE Active = 1;"
Set rsNL = Conn.Execute(SQL)
ReDim arrMonth(rsNL("mm"))
SQL = "SELECT COUNT(DISTINCT Year(Issue)) AS yy FROM tbl_Newsletters WHERE Active = 1;"
Set rsNL = Conn.Execute(SQL)
ReDim arrYear(rsNL("yy"))
As you can see I'm querying twice, works fine, however I would prefer a way to do it in one query.
Anyone?