PDA

View Full Version : [SOLVED:] SQL Add a date from another table



cleteh
03-01-2016, 06:50 PM
SELECT A.FILE_NO, DATE() - 1 AS Yesterday, A.BA_INT_RATE, MAX((SystemDate].[SystemDate]) AS systemDate
FROM Claim AS A
WHERE A.STATUS_CODE = "OPN";

Above is a query in Microsoft Acces 1997 in the part "MAX((SystemDate].[SystemDate]) AS systemDate" I'm wanting to display the most recent systemdate in the systemdate table into a field called systemdate in my query.

The systemdate table simplay has an index in column 1 and the systemdate in column 2. I can't join the table to the table claim in my query. Is there a way to simply display the most recent systemdate in a field called systemdate in my query?

If not is there any suggestions on how I could accomplish this?

Thank you

Bob Phillips
03-02-2016, 06:08 AM
Does this work for you?


SELECT A.FILE_NO, DATE() - 1 AS Yesterday, A.BA_INT_RATE, (SELECT MAX(sys.SystemDate) FROM SystemDate AS sys) AS systemDate
FROM Claim AS A
WHERE A.STATUS_CODE = "OPN";

cleteh
03-08-2016, 10:17 AM
Does this work for you?


SELECT A.FILE_NO, DATE() - 1 AS Yesterday, A.BA_INT_RATE, (SELECT MAX(sys.SystemDate) FROM SystemDate AS sys) AS systemDate
FROM Claim AS A
WHERE A.STATUS_CODE = "OPN";

cleteh
03-08-2016, 10:18 AM
I just got back to this project, but yes thank you that worked