The following is another way of querying the max value for whatever columnmaxId = sqlSelect("Records,@id:string","SELECT MAX(ideliveryId) FROM Neolane.Neolane.NmsrtEvent");logInfo(maxId.Records.@id);In your case, something like the following;maxEventDate = sqlSelect("Event,@maxDate:string","SELECT M...