I have some code that works in Access but now I want to forward the code to our IT department to make a view in our SQL database.
Could anyone please help me convert it so it is correct for normal SQL and not Access SQL if that makes sense?
I have tried to test it in ORACLE SQL Developer but am getting the error:
Error at line 1, column 25: ORA-00923: FROM keyword not found where expected
SELECT T1.*,
(SELECT TOP 1 T3.[SMN_DATEC]-1
FROM
(SELECT T2.[DET_NUMBERA], T2.[SMN_DATEC]
FROM [CHRISCS_EMSAL] AS T2
ORDER BY [DET_NUMBERA],[SMN_DATEC]
) AS T3
WHERE T3.[DET_NUMBERA] = T1.[DET_NUMBERA]
AND T3.[SMN_DATEC] > T1.[SMN_DATEC]
) AS EndDate,
T1.[DET_NUMBERA],
T1.[SMN_DATEC]
FROM CHRISCS_EMSAL AS T1
ORDER BY T1.[DET_NUMBERA],
T1.[SMN_DATEC];
Thanks in advance Chris