Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

Date periods

$
0
0

Hello all,

I need a help with one sql query, please.

I have table with dates and descriptions.

for example
[Date]            [Description]
2013-01-01    description1
2013-01-02    description1
2013-01-03    description1
2013-01-04    description1
2013-01-05    description1
2013-02-01    description2
2013-03-01    description1
2013-03-02    description1
2013-05-01    description3

query must return result like this;

[StartDate]    [EndDate]    [Description]
2013-01-01   2013-01-05  description1
2013-02-01   2013-02-01  description2
2013-03-01   2013-03-02  description1
2013-05-01   2013-05-01  description3

Is this possible with T-SQL only?

Regards
Meelis


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>