Popular Posts
DateTime package bruce.lib; import java.io.Serializable; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Arrays... Translating 1.3 <html> <head>     <title>Translating 1.1</title>     <meta http-equiv="content-type" content="text... Translating 2.0 <html> <head>     <title>Translation 2.0</title>     <meta http-equiv="content-type" content="text...
Stats
Group by Month/ Group by Week
T-SQL
-- Group by month
SELECT
    YEAR([ImportDate]) iYear,
    MONTH([ImportDate]) iMonth,
    SUM([SourceItemCount]) ItemCount,
    SUM([ImportItemCount]) ImportCount
FROM [RssFromOrgImportLog] WITH (NOLOCK)
GROUP BY YEAR([ImportDate]), MONTH([ImportDate])
ORDER BY iYear DESC, iMonth DESC

-- Group by week
SELECT
    DATEADD(dd, (DATEDIFF(dd, -53690, [ImportDate])/7) * 7, -53690) iWeek,
    SUM([SourceItemCount]) ItemCount,
    SUM([ImportItemCount]) ImportCount
FROM [RssFromOrgImportLog] WITH (NOLOCK)
GROUP BY DATEADD(dd, (DATEDIFF(dd, -53690, [ImportDate])/7) * 7, -53690)
ORDER BY iWeek DESC