I have a DataTable and one of the columns is a date column. Is there a way to get the max date from this column?
For example, if the dates listed were 11/1/2020, null, 11/4/2020, 11/2/2020 it would return 11/4/2020
I have a DataTable and one of the columns is a date column. Is there a way to get the max date from this column?
For example, if the dates listed were 11/1/2020, null, 11/4/2020, 11/2/2020 it would return 11/4/2020
Dear @teddy0bear,
You can try the following code:
var highestDate;
var rows = fd.control('DataTable1').value;
rows.forEach(function(row){
if(!highestDate || highestDate < row.DateColumn){
highestDate = row.DateColumn;
}
});
alert(highestDate);
Just replace DateColumn with the Name of your column, and, of course, that's just a sample, it should be inside an appropriate event to be used correctly on the form. If you need any help - just let me know when you want to get this highest date and what you want to do with it.