Hi All,
So I created a separate variable known as PublishedDateColumn assigned with
> ExtractDataTable.AsEnumerable.Select(Function(r) r(0).ToString.Trim).ToArray
ExtractDataTable being the Data Table, I then used a ForEach item in PublishedDateColumn
Using the if statement PublishedDateColumn.Equals(Now.ToString("dd MMM yyyy"))
It would filter the data table removing all values which are not the current date.
The problem is that PublishedDateColumn when using message box is being outputted as System.String() so it will always go to the else statement.
Any help would be appreciated.
Fine
may i know the date format in that column use a writeline activity where mention as datatable.Rows(0)(“date-columnname”).ToString
so based on that we can come up with the expression
@Stabbathehut
it is the one in excel
are we getting the same here in studio with the writeline activity
@Stabbathehut
Its just in a datatable and yes that is correct
great
so use this expression to get the rows with current date
datatable = datatable.AsEnumberable().Where(Function(a) CDate(a.Field(of string)(“yourcolumnnname”).ToString).Equals(Datetime.Now)).CopyToDatatable()
Cheers @Stabbathehut
kindly add this assembly reference in main.xaml by opening that in notepad
When trying to use the AsEnumerable() method on a data table, i receive a error stating that AsEnumerable is not a member of ‘System.Data.Datatable’. I’ve seen someone else with this problem and their solution was to use temporary data table activities in their project to load in the System.Data.DataSetExtension library. However this has not worked for me. Any help would be greatly appreciated.
Thank you.
Cheers @Stabbathehut
Fine
close the studio and reopen the same xaml
you will be able to see the asenumberable function
and kindly type from your end so that you could see the functions and its arguments to be passed while typing
Cheeers @Stabbathehut
loop through your DataTable
and you use if condition like this
row(“yourcolumnname”).ToString = yourCurrentDateTime Variable
1 Like
Thanks for the easy solution
1 Like
No Problem
@Stabbathehut cheers
system
(system)
Closed
January 24, 2020, 5:26pm
14
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.