mercredi, 05 février 2014 10:58

Convert a real datetime to Midas datetime

Share this post

This Scalar-valued function return a Midas datetime from a real datetime. In midas, the date are the number of day since 1971-12-31.

ALTER FUNCTION [dbo].[udf_DateSqlToMidas]
(
	@Date		datetime
)
RETURNS int
AS
BEGIN

RETURN datediff(day, '1971-12-31', @Date)

END

 

Lu 27177 fois