How do i filter dates older than 01-05-2022. my date column is “Period From”
I tried filter data table activity but it is not working Hence, tried the select query and it looks like below
out_dt_fb(DataTable) = dt_fb.Select (“Period From< ‘01-05-2022’”).CopyToDataTable()
with this select query i am facing “Syntax error: Missing operand after ‘From’ operator.” exception.
Plz help in correcting the above query.
Hi @Suhas_M ,
Firstly, Could you check with the modified expression below :
out_dt_fb(DataTable) = dt_fb.Select ("[Period From] < '01-05-2022'").CopyToDataTable()
Check if the above works and Gives out the proper output.
If the above does not work, then give a try on the below Expression :
inputDate = DateTime.ParseExact("01-05-2022","dd-MM-yyyy",System.Globalization.CultureInfo.InvariantCulture)
inputDate is a variable of type DateTime.
Next, we use this Date variable for comparison like below and fetch the rows corresponding to older dates :
More on DateTime and analysis :
Let us know if you are able to perform the appropriate filtration using this method.
can you try
dt_fb.Select ("[Period From] < #01-05-2022#').CopyToDataTable()
[ ] to surround the col name as it has space
# for a date compare
when an empty result can occur handle it as described here:
When it is not working then share with us the datatable content by using the immediate panel
What about this
If(dtTest.Select(“[Period From] < #01-05-2022#”).Count>0,dtTest.Select(“[Period From] < #01-05-2022#”).CopyToDataTable,Nothing)
#01-05-2022#" = MM-dd-yyyy
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.