--:SetVar Function "AUX:PureDate"
if exists( select * from [sysobjects] (nolock) where [type] in ('FN','TF') and [name]=N'AUX:PureDate' )
   drop function [AUX:PureDate]
GO
/* Translated by $SQLTRANS utility (SQL-file technology). Method author: Sergei Y.Kitáev.
** Script translation date-time: 2022-11-27 00:29:27.24 (stamp of SQL-file generation). */
create function [AUX:PureDate]( @DateTime datetime2 )
returns datetime2
BEGIN
/*==================================================================================================
# SQLAUX scripting library | Author: Sergei Y.Kitáev
----------------------------------------------------------------------------------------------------
#
# MAKING PURE DATE VALUE (ONLY DAY, MONTH AND YEAR PARTS):
#
# === Usage: ===
# dbo.[AUX:PureDate]( <Date-time> )
#
==================================================================================================*/

return dbo.[AUX:DateValue.YMD](
   YEAR ( @DateTime ),
   MONTH( @DateTime ),
   DAY  ( @DateTime ) )

/*================================================================================================*/
END
GO
/*
select dbo.[AUX:PureDate]( CONVERT(datetime2,'11/17/2015',101) ) 'Pure date value'
select dbo.[AUX:PureDate]( CONVERT(datetime2,'17.11.2015',104) ) 'Pure date value'
select dbo.[AUX:PureDate]( GETDATE() ) 'Pure date value'
*/
