cancel
Showing results for 
Search instead for 
Did you mean: 

Month Must be between 1-12

Former Member
0 Kudos

We are running a report with filter of the following:

if {tblWorkInProgress.Date21} in [date(year(currentdate),month(currentdate),1) to

dateadd("d",-1,date(year(currentdate),month(currentdate)+1,1))]then

true

Now obviously this error only happens when the report is tried to run in December as current month of 12 plus 1 is 13 which doesn't exist.  So the report is working perfect now.

But how can I accomplish this same thing so the report works all year. I didn't build this report just inheriting it.

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

abhilash_kumar
Active Contributor
0 Kudos

Hi David,

This should work fine:

{tblWorkInProgress.Date21} IN [Minimum(MonthToDate) TO dateserial(year(currentdate),month(CURRENTDATE)+1,1-1)]

P.S: You don't need to return true or false.

-Abhilash

Former Member
0 Kudos

Thanks that worked great.  Didn't even know about that command.

Answers (0)