Need to filter only difference with Time column with current time, if greater than 50 min then filter only those rows
Anyone please
thanks
shaik
Need to filter only difference with Time column with current time, if greater than 50 min then filter only those rows
Anyone please
thanks
shaik
Can you please try to this linq
dtInput.AsEnumerable().Where(Function(row) (DateTime.Now - DateTime.Parse(row.Field(Of String)(“Time”))).TotalMinutes > 50).CopyToDataTable()
Thanks,
Rashmi
can you please share your input file
My Input Excel:
Dispatcher.xlsx (8.8 KB)
Hi @shaik.muktharvalli1
try this linq query
dt.AsEnumerable().Where(Function(row)DateTime.Now.TimeOfDay.Subtract(DateTime.Parse(row(“Time”).ToString).TimeOfDay).TotalMinutes > 50).CopyToDataTable()
Thanks for sharing,
Can you tr this below linq
dt.AsEnumerable().Where(Function(x) DateTime.Parse(x(“Time”).ToString()).TimeOfDay > DateTime.Now.TimeOfDay.Add(TimeSpan.FromMinutes(50))).CopyToDataTable()
instead if using this directly
take one assign activity, create one new variable with datatype list
pass that variable in TO and in value field pass
dt.AsEnumerable().Where(Function(x) DateTime.Parse(x(“Time”).ToString()).TimeOfDay > DateTime.Now.TimeOfDay.Add(TimeSpan.FromMinutes(50))).Tolist()
take one if condition
keep condition List variable.count>=1
in then section take one assign activity,
in To Pass your dt variable and in Value: list variable.copytodatatable().
in else block keep your log message
try this if you are facing any hurdle please let me know
if it’s works please mark it as solution
Hi @Akash_Javalekar1 Linq query working but out not excepted, getting whole date time but I need only hh:mm
thanks
shaik
okay wait will give you updated linq
dt.AsEnumerable().Where(Function(x) DateTime.Parse(x(“Time”).ToString()).TimeOfDay > DateTime.Now.TimeOfDay.Add(TimeSpan.FromMinutes(50))).CopyToDataTable()
you can use this linq and while reading data click on check box on preserved formate in Reade range workbook activity
output
Happy Automation!!
Try this one
dt.AsEnumerable().Where(Function(row) DateTime.Now.TimeOfDay.Subtract(DateTime.Parse(row(“Time”).ToString).TimeOfDay).TotalMinutes > 50).Select(Function(row) dt.Clone.LoadDataRow(New Object() {row(“CR_Number”), row(“Country”), DateTime.Parse(row(“Time”).ToString).ToString(“HH:mm”)}, False)).CopyToDataTable()
I hope this will work
happy automation
now it’s working fine when I have checked PreseveFormat
Thank you @Akash_Javalekar1 and @yedukondaluaregala
Thanks for the update
Please mark it as solution
Happy Automation
Glad to help !
Thanks
Happy Automation
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.