Is it possible to modify the day part of a date without having to use DateAdd or having to calculate the date difference?
SET @ReturnDate = '5/16/2012'
SET @ModifyDay = 20
Modify only 16 to 20
Result should be 5/20/2012
The reason for this is that I am translating vb code into a stored proc:
Dim InvDate_Day_of_Month As Integer = CInt(Day(InvDate))
PaymentDate = DateAdd(DateInterval.Month, 1, InvDate)
PaymentDate = New Date(PaymentDate.Year, PaymentDate.Month, DayofTheMonth)
1 Answer