Posts_per_Year

Gets list of years and total of posts per year from a table, by using date column, passing table name and column name with date to summarize by.
Returns Year{{$C$}}45{{$R$}}2007{{$C$}}44{{$R$}}...

CodeFunctionName
What is this?

Public

Tested

Original Work
Function Posts_per_Year(TableName, DateColumn)
FSQL = "SELECT yoyo, SUM(coco1) AS coco FROM (SELECT YEAR(" & DateColumn & ") AS yoyo, COUNT(*) AS coco1 FROM " & TableName & " GROUP BY " & DateColumn & ") AS derivedtbl_1 GROUP BY yoyo ORDER BY yoyo DESC"
set recF = connection.execute(fSQL)
Do Until recF.Eof
GGe = GGe & trim(recF("yoyo")) & "{{$C$}}" & trim(recF("coco")) & "{{$R$}}"
recF.MoveNext
Loop
Posts_per_Year = GGe
End Function

TableName, DateColumn

Views 5,197

Downloads 1,466

CodeID
DB ID