Date Custom Attributes
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], 'e5f9b735-7277048bb-b3fd-47074a71e820') AS [Operating System Expiry]
FROM [dbo].[ItemCore]
WHERE
[dbo].[ItemCore].[ItemDeletedDate] IS NULL