Get Distinct Maximum Date

Get Distinct Maximum Date Display the latest order of each customers. SELECT A.CustomerID, OrderDate, EmployeeID, ShipperID FROM Orders AS A INNER JOIN(SELECT CustomerID, MAX(OrderDate) AS MaxOrderDate FROM Orders…

Read More

Calculate Total Hour and Minute in SQL

SELECT ((DATEDIFF(minute, ‘2013-06-30 08:30:00.0000000’, ‘2013-06-30 10:45:00.0000000’))/60) AS TotalHour,        ((DATEDIFF(minute, ‘2013-06-30 08:30:00.0000000’, ‘2013-07-30 10:45:00.0000000’))%60) AS TotalMinute The result of the above query is: TotalHour    TotalMinute      …

Read More

Multiple JOIN in MS Access

When you query a multiple join in MSSQL you use this following query:SELECT a.columna, b.columnb, c.columncFROM tablea AS a LEFT JOIN tableb AS b ON a.id = b.id…

Read More