Hi everyone! I am trying to combine the SELECT and UPDATE query but it’s not working. I want to use the SELECT query to retrieve the result and execute the UPDATE query using the retrieved values.
I probably need a little more information to answer this fully but Five does support UPDATE SQL commands based on a SELECT.
For example if you are trying to achieve eeverything in one query you could execute:
UPDATE
User
SET
LastAccessDate = (SELECT MAX(AccessDate) FROM LogFile WHERE LogFile.UserKey = User.UserKey);
If you are using queries inside logic it would require a five.executeQuery() command for the SELECT statement and then a loop going through the results executing another five.executeQuery() with the UPDATE statement for each record you wanted to update.
Hope this helps but let me know if you need more information.