To access the System.DateTime value of a date custom attribute view the configuration and note the identifier.




To access the value of the custom attribute the GetCustomAttributeDateTime function can be used, this will return a T-SQL DATETIME2 value, or NULL if the custom attribute is not defined.


SELECT 

  [dbo].[ItemCore].[ItemID] AS [ItemID], 

  [dbo].[ItemCore].[Name] AS [Name],

  [dbo].[GetCustomAttributeDateTime] ([dbo].[ItemCore].[ItemID], '87e69d55-6b59-42ff-b525-800daf18a0e3') AS [Operating System Expiry]

FROM [dbo].[ItemCore]

WHERE 

  [dbo].[ItemCore].[ItemDeletedDate] IS NULL