I have a problem when changing access code to SQL Server. I am trying to save the data in SQL Server, not in the Access database.
Access code
SELECT MAX("SPR-" & VAL(Replace([RequestID],"SPR-",""))+1) AS AutoID
FROM Tb_Request;
SQL Server:
SELECT FORMAT(MAX(1 + REPLACE(RequestID, 'SPR-', '')),'SPR-#') AS RequestNo
FROM dbo.PilotRequest
I think I changed correctly because I checked in SQL Server, the result is correct.
When I apply this code in Access, the result looks like this:
(There is data in the dbo.PilotRequest table, which is '5555'.)
Is there anyone who knows the reason for this?


5555but your picture shows that you query5556