Quantcast
Channel: SQLServerCentral » SQL Server 2014 » Development - SQL Server 2014 » Latest topics
Viewing all articles
Browse latest Browse all 3145

Simple SQL challenge - who can solve

$
0
0
Hi,Simple little requirement.Need to display first date of each of the 12 months prior to current date, i.e. "Last Twelve Months" for reporting purposes.i.e. today is 10th May 2016 so we need this:2016-05-01 00:00:00.0002016-04-01 00:00:00.0002016-03-01 00:00:00.0002016-02-01 00:00:00.0002016-01-01 00:00:00.0002015-12-01 00:00:00.0002015-11-01 00:00:00.0002015-10-01 00:00:00.0002015-09-01 00:00:00.0002015-08-01 00:00:00.0002015-07-01 00:00:00.0002015-06-01 00:00:00.000I have some possible solutions in the pipeline but feel there's probably a simpler way out there

Viewing all articles
Browse latest Browse all 3145

Trending Articles