Mercoledì, 05 Febbraio 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

 

Letto 27150 volte