Hello Team,
Could you please help me what needs to be done to filter filter the DT and get the earliest time stamp shown in the picture.
Thanks
Hello Team,
Could you please help me what needs to be done to filter filter the DT and get the earliest time stamp shown in the picture.
Thanks
Hello @Venu_V
Try with:
Assign date_Earliest = dt_Datatable.AsEnumerable().Select(Function(row) DateTime.ParseExact(row("ConnectionUptime").ToString(), "yyyy-MM-dd HH:mm:ss", New System.Globalization.CultureInfo("da-DK"))).Min()
Regards
Soren
thank you. I will try this solution now
@Venu_V
I can see that I forgot my danish CultureInfo - just adapt the one relevant for you
And I have changed to correct format
yyyy-MM-dd HH:mm:ss
Regards
Soren
not working it says value of date cant be converted to data table
please help . i am getting an error
is your data in excel if yes then you can sort it based on the timestamp column and pick the first row. if not then then use something like
DT.AsEnumerable().OrderBy(Function(row) row.Field(Of DateTime)("ConneectionUptime")).FirstorDefault()
this will give you the timestamp use it to find the matching row in the dt and pick your data from there
the linq outputs a DateTime not datatable change the variable type
if my data is in excel how i can sort it , please explain
there is sort range activity
The variable date_Earliest should be of type DateTime.
Then you have the earliest date present in the Excel file saved as a DateTime variable.
Regards
Soren