Basit Khan

Basit Khan

  • NA
  • 336
  • 121.8k

FromDate & ToDate to be Changed after 14 Days.

Dec 17 2015 12:06 AM
Dear I have table called Mst_Crew.
Fields are
Cr_No numeric
Cr_Name varchar
FromDate date
ToDate date
I need to change the FromDate & ToDate when the ToDate pass the currentdate then need to be add 14Days on FromDate
For Example
CrNo CrewName FromDate ToDate
1 A 29-Nov-15 13-Dec-15
2 B 06-Dec-15 20-Dec-15
3 C 13-Dec-15 27-Dec-15
4 D 22-Nov-15 06-Dec-15
The Next Change will be
CrNo CrewName FromDate ToDate
1 A 27-Dec-15 10-Jan-16
2 B 03-Jan-16 17-Jan-16
3 C 10-Jan-16 24-Jan-16
4 D 20-Dec-15 03-Jan-16
It means that.
When Todate<GetDate() then in FromDate Column ToDate+14 and in ToDate Column FromDate+14
How to do this in SQL
Thanks
Basit.

Answers (1)