Your application or website rely on your database to deliver information about products and services to your customers. You can’t afford to have your database lose performance, lose availability or become unresponsive – even for just a few minutes.
CREATE function [dbo].[wfThisMonthEndDate] (@today as smalldatetime) Returns smalldatetime AS BEGIN DECLARE @datestring AS VARCHAR(10) DECLARE @date SMALLDATETIME; SET @datestring = CONVERT(VARCHAR(10),@today,103) SET @date = @datestring DECLARE @start SMALLDATETIME, @endDay SMALLDATETIME; SET @start = DATEDIFF(DAY,0,@date); SET @endDay = DATEADD(MONTH,1,@date)-DAY(@start); SET @datestring = CONVERT(VARCHAR(10),@endday,111) RETURN @datestring END
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.