Welcome to SpiderWiki,
There are currently 131 articles.

SQL: Post time function

From SpiderWiki
Jump to: navigation, search


I set this up to convert time from UK Time (RMS converts to this by default) back to post time.

 CREATE FUNCTION  post_time 
 ( @mydate AS datetime, @machine AS VARCHAR(20) )
 RETURNS datetime
 AS
    BEGIN 
		DECLARE @wbias INT
		DECLARE @returndate datetime
        SELECT @wbias=wbias FROM rwin32_timezone WHERE userid=@machine
		SELECT @returndate=dateadd(MINUTE,@wbias,@mydate)
	    RETURN @returndate 
	--	RETURN @wbias
    END