Count rows with 2 conditions

Hello developpers,

i want to count rows or column ‘StatuT = KO’ and when column ‘Date de reception’ and month-1 relative to current month.


In my image the resultat = 2

Can you help me ?

Thanks four your returns !

Hi @mateo.drouillard

Use filter datatable to filter required rows and then dt.rowcount will give the result


How filter the column ‘Date reception’ with mouth-1 ?

Hi @mateo.drouillard

You can use 'Date reception' greater than Date.Parse("01/" + Now.AddMonths(-1).ToString("MM") + Now.AddMonths(-1).ToString("yyyy"))

and 'Date reception' Less than Date.Parse(Datetime.DaysInMonth(Cint(Now.AddMonths(-1).ToString("yyyy")),Cint(Now.AddMonths(-1).ToString("MM"))) + Now.AddMonths(-1).ToString("MM") + Now.AddMonths(-1).ToString("yyyy"))

If input column is of not date type then remove date.Parse


1 Like

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