SachAccess
Active member
- Local time
- Today, 17:39
- Joined
- Nov 22, 2021
- Messages
- 410
Hi Experts,
I am doing it for learning purpose. I am trying to combine Max query with Insert query.
However, am not able to do it, can anyone please help me with this.
Both queries are working good if applied differently.
INSERT INTO tbllog ( id, [query name], [running time] )
VALUES (Max(ID) +1 FROM tbllog)), 1, 1);
SELECT Max(ID) +1 AS MaxID
FROM tbllog;
INSERT INTO tbllog ( id, [query name], [running time] )
VALUES (1, 1, 1);
I am doing it for learning purpose. I am trying to combine Max query with Insert query.
However, am not able to do it, can anyone please help me with this.
Both queries are working good if applied differently.
INSERT INTO tbllog ( id, [query name], [running time] )
VALUES (Max(ID) +1 FROM tbllog)), 1, 1);
SELECT Max(ID) +1 AS MaxID
FROM tbllog;
INSERT INTO tbllog ( id, [query name], [running time] )
VALUES (1, 1, 1);