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

Query

$
0
0
HI Everyone,can any one write one dynamic query based on fromdate and Todate columns data should come as mentioned below declare @tbl table (id int,Fromdate datetime,Todate datetime)insert into @tbl select 1,'2015-APR-02','2016-FEB-28'select * from @tbl output needed as mentioned below ID Fromdate Todate1 2015-APR-02 2015-DEC-311 2016-JAN-01 2016-FEB-28insert into @tbl select 1,'2015-APR-02','2017-Feb-28'select * from @tbl output needed as mentioned below ID Fromdate Todate1 2015-APR-02 2015-DEC-311 2016-JAN-01 2016-DEC-311 2017-JAN-01 2017-FEB-28

Viewing all articles
Browse latest Browse all 3145

Trending Articles