August 15, 2007 at 11:37 am
I'm trying to make a field called "maturity date" which gives the date that a contract my company has written will be fully matured. The way to calculate this is to add the number of terms(months) to the first payment date. Is it possible to add say 24 months to the month field of the first payment date?
August 15, 2007 at 11:41 am
Look up DATEADD function in BOL (Books Online)
DECLARE @PayDate datetime
SET
@PayDate = '2007-01-01'
SELECT
DATEADD(MONTH, 24,@PayDate)
August 15, 2007 at 12:28 pm
Using the MSDN article, that doesnt seem to be working. Check out my expression:
=DateAdd (Month, Fields!CONTRACT_TERM.Value, Fields!FIRST_PAY_DATE.Value)
Do you see anything I could be doing wrong?
August 16, 2007 at 6:41 am
Russel
I used example from sqljunkie myself and it works just fine
Is yr dateformet set wel ?
Use the set dateformat function otherwise, e.g. set dateformat mdy before yr statement.
Good luck
JV
August 16, 2007 at 7:59 am
I ended up having to add something else to it. This is how it worked for me.
=DateAdd (DateInterval.Month, Fields!CONTRACT_TERM.Value, Fields!FIRST_PAY_DATE.Value)
That expression adds the number of months contained in CONTRACT_TERM to the date contained in FIRST_PAY_DATE. Thanks for your help guys!
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply