Assign Selection Criteria not working

CE version 2019.5.0

I have a process where only items >= 7 days out should be looked at. When I run the job it’s grabbing dates that don’t match the selection. I’m sure I’m missing something dumb/obvious in my Assigns, but I’m not sure what it is.

Variable: NxtWk Type: String =DateTime.Today.AddDays(+7).ToShortDateString

Write line returns 6/25/2019 as expected.

Variable: FilteredDT Type: DataTable =DT1.Select(“State=‘Approved’ or State=‘Approved Credit Pass’ and FirstDateAffected>=’”+NxtWk+"’").CopyToDataTable

The results are written to an excel file, which is showing the correct selection for State, but not FirstDateAffected.

HI @rridlen
Fine try with this buddy
FilteredDT=DT1.Select(“[State]=‘Approved’ or [State]=‘Approved Credit Pass’ and [FirstDateAffected] >= #”+NxtWk+"# ").CopyToDataTable

Cheers

Thank you, but it didn’t take it.

Message: Syntax error: Missing operand after ‘Credit’ operator.

You can pass NxtWk variable without convert to String using Filter Datatable Activity instead filtering via code.

The Filter Data Table activity is also still giving results it shouldn’t - 6/16-6/24. Is the NxtWk variable incorrectly setup?

Removing the variable and using the code directly in the Filter Data Table activity did it. Thank you.

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