Tag: SQL Equivalent function to NEXT_DAY


T-SQL equivalent for NEXT_DAY() of ORACLE

I thought of creating a simple function for this operation, in T-SQL. Function Name: Next_Day Input Params: @FromDate - Date from which you wish to get the next day; @DayNumber - Day of week for which you wish to get the next day (6=>Saturday, 7=>Sunday) Operation: SELECT dbo.Next_Day(GETDATE(),6) //Returns the next Saturday (6) from today Function: Function body ...