Wednesday, 05 February 2014 10:53

Convert a Midas datetime to SQL

Share this post

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

ALTER FUNCTION [dbo].[udf_DateMidasToSql]
(
	@Days		int
)
RETURNS datetime
AS
BEGIN

RETURN dateadd(day, @Days, '1971-12-31')

END
Read 26421 times Last modified on Wednesday, 05 February 2014 10:58