--:SetVar Function "AUX:IsPureDate"
if exists( select * from [sysobjects] (nolock) where [type] in ('FN','TF') and [name]=N'AUX:IsPureDate' )
   drop function [AUX:IsPureDate]
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:IsPureDate]( @Date datetime2 )
returns bit
BEGIN
/*==================================================================================================
# SQLAUX scripting library | Author: Sergei Y.Kitáev
----------------------------------------------------------------------------------------------------
#
# CHECKING DATE-TIME, THAT IT HAS NOT SMALL COMPONENTS (LESSER THAN DAY PART) —
# ONLY DAY, MONTH AND YEAR PARTS ARE ADMISSIBLE:
#
# === Usage: ===
# dbo.[AUX:IsPureDate]( <Date> )
#
==================================================================================================*/
return
   case
      when @Date is not null and
           dbo.[AUX:PureDate]( @Date ) = @Date
      then 1 else 0
   end
/*================================================================================================*/
END
GO
/*
select dbo.[AUX:IsPureDate]( CONVERT(datetime2,'17.11.2015',104) ) 'Is pure date'
select dbo.[AUX:IsPureDate]( GETDATE() ) 'Is pure date'
*/
