Filter datatable based on dates

Hi,
I have an excel sheet in which I have to filter the datatable on 2 points

  1. If status is ABC Completed.
  2. IF Current day is Monday than filter the Completion dates based on Friday,Saturday,Sunday.
    Using the above filtering the datatable can be empty also if both the conditions do not match.
    I have attached the excel sheet for the same.
    Book1.xlsx (1.2 MB)
    I have managed to solve for the Filtering of Status, but can anyone suggest on how to filter based on the above 2nd condition.

HI

SELECT * FROM YourTableName
WHERE Status = ‘ABC Completed’
AND (Weekday(Now()) = 2 AND Weekday(CompletionDate) IN (6, 7, 1))

Try this

Hi @Moulika_Kaviti
This code I have to run on assign activity or invoke code??

use Assign activity assign to one variable

@Moulika_Kaviti
The datatype of the variable will be Datatable??
Also It is giving error

@supermanPunch @Gokul001 @ushu @kirankumar.mahanthi1 @Palaniyappan @Sudharsan_Ka @Anil_G
Can you suggest something please?

Hi
@Kunal_Jain

Try this below xaml is the code
forum.xaml (11.7 KB)
for your requirement

Hey @Moulika_Kaviti
Thanks for the Help.
I got the solution

Assign a data table and paste the below query
DT.Select(“[Date Column] >= #”+Dates.ToString +“# AND [Date Column] <= #”+Dates2.ToString+“#”).CopyToDataTable
Where Date Column is the column of your Datatable containing Date
And
Dates and Dates2 are the variables with datatype date time.
Cheers

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