3 Replies Latest reply: Sep 6, 2017 1:07 PM by Sunny Talwar

# error on the last line only

the code runs if i comment out the last line , with the last line uncommented i get an error saying "takes 2 -3 parametres" . I think its the brackets

if( [M/E DAT REC]='?','?',
if(([V JAAR]*100)+[V MAAND]=((Year(Today())*100)+Month(Today()))-1 and  floor((today()-date((date#( [M/E DAT REC],'DD/MM/YYYY')),'YYYY/MM/DD'))/30.417)=0,'0',
if(Floor((Date(MonthEnd(MakeDate([V JAAR],[V MAAND],10)),'YYYY/MM/DD')+1-1-date((date#( [M/E DAT REC],'DD/MM/YYYY')),'YYYY/MM/DD'))/30.417)=0,'0',
if(([V JAAR]*100)+[V MAAND]=((Year(Today())*100)+Month(Today()))-1 and  floor((today()-date((date#( [M/E DAT REC],'DD/MM/YYYY')),'YYYY/MM/DD'))/30.417)<=1,'<=1',
if(Floor((Date(MonthEnd(MakeDate([V JAAR],[V MAAND],10)),'YYYY/MM/DD')+1-1-date((date#( [M/E DAT REC],'DD/MM/YYYY')),'YYYY/MM/DD'))/30.417)<=1,'<=1',
if(([V JAAR]*100)+[V MAAND]=((Year(Today())*100)+Month(Today()))-1 and  floor((today()-date((date#( [M/E DAT REC],'DD/MM/YYYY')),'YYYY/MM/DD'))/30.417)>1 and  floor((today()-date((date#( [M/E DAT REC],'DD/MM/YYYY')),'YYYY/MM/DD'))/30.417)<=3,'>1',
if(Floor((Date(MonthEnd(MakeDate([V JAAR],[V MAAND],10)),'YYYY/MM/DD')+1-1-date((date#( [M/E DAT REC],'DD/MM/YYYY')),'YYYY/MM/DD'))/30.417)>1 and  if(Floor((Date(MonthEnd(MakeDate([V JAAR],[V MAAND],10)),'YYYY/MM/DD')+1-1-date((date#( [M/E DAT REC],'DD/MM/YYYY')),'YYYY/MM/DD'))/30.417)<=3 ,'>1'))))))))

• ###### Re: error on the last line only

So the error is in this piece of code

if(Floor((Date(MonthEnd(MakeDate([V JAAR],[V MAAND],10)),'YYYY/MM/DD')+1-1-date((date#( [M/E DAT REC],'DD/MM/YYYY')),'YYYY/MM/DD'))/30.417)>1 and  if(Floor((Date(MonthEnd(MakeDate([V JAAR],[V MAAND],10)),'YYYY/MM/DD')+1-1-date((date#( [M/E DAT REC],'DD/MM/YYYY')),'YYYY/MM/DD'))/30.417)<=3 ,'>1'))))))))

• ###### Re: error on the last line only

Your error is here.... if that is what you are interested int

• ###### Re: error on the last line only

May be this

If([M/E DAT REC]='?', '?',

If(([V JAAR]*100) + [V MAAND] = ((Year(Today())*100)+Month(Today())) - 1 and Floor((Today() - Date#([M/E DAT REC], 'DD/MM/YYYY'))/30.417) = 0, '0',

If(Floor((MonthEnd(MakeDate([V JAAR],[V MAAND],10)) + 1 - 1 - Date#([M/E DAT REC], 'DD/MM/YYYY'))/30.417) = 0, '0',

If(([V JAAR]*100) + [V MAAND] = ((Year(Today())*100)+Month(Today())) - 1 and Floor((Today() - Date#([M/E DAT REC], 'DD/MM/YYYY'))/30.417) <= 1, '<=1',

If(Floor((MonthEnd(MakeDate([V JAAR],[V MAAND],10)) + 1 - 1 - Date#([M/E DAT REC], 'DD/MM/YYYY'))/30.417) <=1, '<=1',

If(([V JAAR]*100) + [V MAAND] = ((Year(Today())*100)+Month(Today())) - 1 and Floor((Today() - Date#([M/E DAT REC], 'DD/MM/YYYY'))/30.417) > 1 and Floor((Today() - Date#([M/E DAT REC], 'DD/MM/YYYY'))/30.417) <=3, '>1',

If(([V JAAR]*100) + [V MAAND] = ((Year(Today())*100)+Month(Today())) - 1 and Floor((Today() - Date#([M/E DAT REC], 'DD/MM/YYYY'))/30.417) > 1 and  If(([V JAAR]*100) + [V MAAND] = ((Year(Today())*100)+Month(Today())) - 1 and Floor((Today() - Date#([M/E DAT REC], 'DD/MM/YYYY'))/30.417) <= 3 , '>1')))))))