where date = max(date) in sql
SELECT report_id, computer_id, date_entered
FROM reports AS a
WHERE date_entered = ( SELECT MAX(date_entered) FROM reports );
where date = max(date) in sql
SELECT report_id, computer_id, date_entered
FROM reports AS a
WHERE date_entered = ( SELECT MAX(date_entered) FROM reports );
difference between min and max date sql
SELECT
T.location,
Maxv.Amount - Minv.Amount as difference
FROM
(
SELECT
location,
MIN(date) MinDate,
MAX(date) MaxDate
FROM
Tbl A
GROUP BY
location
) T INNER JOIN
Tbl Minv ON T.MinDate = Minv.date AND T.location = Minv.location INNER JOIN
Tbl Maxv ON T.MaxDate= Maxv.date AND T.location = Maxv.location
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us