Click here to Skip to main content
15,908,674 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Need to generate a new date with the Day given and the current month and current year given, such that with the period specified the new date will be generated using the date function


SET JDAY = 14

SET JMONTH = 11

SET JYEAR = 2014


Need to generate a new date with a certain number of months from the above months=11 and year=2014



1. Period or Months =15 from the above while maintaining the day =14

using

SET @FDATE = DATEADD(DAY,@JDAY-1,DATEADD(MONTH,@CCMTH-1,DATEADD(YEAR,@CCYR-1900,0)))


How do you accomplish it?

Expected Date is 14/02/2016 using the British Date Format

Thanks
Posted
Updated 7-Aug-15 19:06pm
v4
Comments
Patrice T 8-Aug-15 3:08am    
What have you tried ?
did you search on internet ?
Where is your problem ?
Member 10744248 8-Aug-15 4:48am    
How do you use the Function to generate the expected date
Maciej Los 10-Aug-15 18:24pm    
What is @CCMTH and @CCYR?
Please, provide more details.

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900