DECLARE @MyDate datetime SET @MyDate = Getdate() SELECT CASE WHEN DATEPART(HOUR,@MyDate) >12 then Convert(VARCHAR(28), Cast(@MyDate AS DATETIME), 8) +' PM' ELSE Convert(VARCHAR(28), Cast(@MyDate AS DATETIME), 8) +' AM' END
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)