Skip to content

Latest commit

 

History

History
18 lines (15 loc) · 768 Bytes

readmeSql.md

File metadata and controls

18 lines (15 loc) · 768 Bytes

T-SQL

To get an idea of a mirror image to EF Core I created a SQL Fiddle shown below. Using SqlClient data provider a developer must perform a conversion as a DataReader does not know about DateOnly or TimeOnly.

SELECT VL.VistorLogIdentifier AS [Log id],
       VL.VisitorIdentifier AS [Visitor Id],
       FORMAT(VL.VisitOn, 'MM-dd-yy') AS [Visit on],
       FORMAT(CAST(VL.EnteredTime AS DATETIME), 'hh:mm tt') AS [Entered],
       FORMAT(CAST(VL.ExitedTime AS DATETIME), 'hh:mm tt') AS [Exited],
       V.FirstName + ' ' + V.LastName AS [Full Name]
FROM dbo.VisitorLog AS VL
    INNER JOIN dbo.Visitor AS V
        ON VL.VisitorIdentifier = V.VisitorIdentifier
ORDER BY VL.VisitOn DESC;

x