Calculating min of Dates

I have Date Column in DT
Convert.ToDateTime(DT.Compute(“MIN(Date)”,“”))
This isn’t working if date format is in dd.MM.yyyy
Is thier any alternative solution?

Hi @Vamshi_Krishna_Aluvala

Try below expression

Convert.ToDateTime(DT.Compute(“MIN(Date)”,“”).ToString)

give a try on:

minDate | DateTime =

DT.AsEnumerable.Min(Function (x) DateTime.ParseExact(x("Date").toString.Trim, "dd.MM.yyyy", System.Globalization.CultureInfo.InvariantCulture))

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.