The DateDiff = 23 so 23/30 is 0.77.
I cannot get @Tenor to be 1, which is 0.77 rounded ... it keeps giving me 0 ...
DECLARE @Tenor Decimal(18,6)
SET @Tenor = ROUND(DATEDIFF(D,'2014-04-14','2014-05-07') / 30, 0)
It works if I do this ... this will give me 1. But I need to use the method above because it's all in an UPDATE statement. Tips appreciated, thanks.
DECLARE @Tenor Decimal(18,6)
DECLARE @dd decimal(18, 6)
SELECT @dd = DATEDIFF(D, '2014-04-14', '2014-05-07')
SET @Tenor = Round(@dd/30,0)