4 Replies Latest reply on Jan 19, 2018 11:04 AM by chrish RSS
    chrish Explorer

    How to return MAX() from a specific field in Data Table?

    I'm trying to create a service that I can globally put in a ThingShape; then reference inside every new DataTable that I create. This service will find the PK of each new data table and ensure that it is populated with a unique/increasing value. To do this, I need to be able to find the current MAX() value of all data in the data table for the PK field; then set new row PK field to MAX()+1.


    If I'm simply way out in left field...please reign me in, but I think I'm close.


    Please provide a sample script for how to query this information from an existing data table.