Error "No Data Rows" But value is correct

Hi,

I have an automation to make remarks A and remarks B of an insurance.

Example :

John will have his insurance expired on 28 August 2022. The reminder is set 2 months before it expired, I assign it like this :

image

Given image on top is comparing the Insurance Date (Because my workflow getting the tenor every year and comparing it to today with “Greater Than Equal Symbol (>=)”), which should be getting the value same as today. The dt_filter variable type is a DataTable

And this is my if :

Inside the dt_filter for each, there is an if shown below :

image

When I tried to run my program, there’s an error like this :

image

The error is occured on the Assign as seen on top (which is refferring to assign in the first picture). When I write line the value the insurance that will end this year (which is the last tenor of it) is always throwing error as seen on top…

Any solution for this?

Hi,
can you please try with below select query,
as this is working for my case.

If(dt1.Select("[Insurance_Date]<=’"+date.Now.ToString+"’").Count=0,new DataTable, dt1.Select("[Insurance_Date]<=’"+date.Now.ToString+"’").CopyToDataTable())

1 Like

Thank you, it works ! I just have to change the ’ to # because there’s an operand error… Can you explain by the way how this code works? Thanks !

Hi,

Error message “The source contains no DataRows.”

If there are no result in data table select query, to avoid this need to check count before assign if no result came then assign a empty Data table else assign filtered datatable.

thanks,

I see, thank you very much !

1 Like

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