Skip to main content
Announcements
Defect acknowledgement with Nprinting Engine May 2022 SR2, please READ HERE
cancel
Showing results for 
Search instead for 
Did you mean: 
konidena
Creator
Creator

How to create the date expression in Nprinting 17 Conditions

Hi Team,

I am using Nprinting 17 for reporting.

I have a variable in my report.

vDateToApply.

This will get the yesterday's date on daily refresh.

Sometimes , the refresh won't happen because of db refresh issue. So, this variable will not get the latest Yesterday's date.

To check that, I am creating nprinting report to show the vDateToApply value to Admin by sending the mail from NPrinting.

But the Admin don't need this mail on successful refresh. Whenever this date don't have the latest "Yesterday's date", they should get the mail.

To achieve this, i created one condition in Nprinting.

vDateToApply=07/24/2018

I given the expression as below but it is showing false. Please tell me the right way of writing the expression.

Conditions.PNG

Thanks in advance.

Regards

Srinivas

1 Solution

Accepted Solutions
balabhaskarqlik

May be use like this:

=text(date( today()-3 , 'MM/DD/YYYY'))


or


=text(date( today()-3 , "M/DD/YYYY"))

View solution in original post

2 Replies
balabhaskarqlik

May be use like this:

=text(date( today()-3 , 'MM/DD/YYYY'))


or


=text(date( today()-3 , "M/DD/YYYY"))

Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

As always there 2 sides of equation. So you have your variable and your expression.

I agree with Bala that it is important to bring both sides of equation to the same data type - in your case it is likely to be text, but

there are 2 things you can do to check why it is not working

  • check how NPrinitng is understanding your variable by exposing it in a temporary report (for example by adding it to excel template and previewing it)
  • It might be that your variable is not evaluating and therefore is not returning value (or rather returning Null())
  • The last thing you might do is to convert your variable value to number by applying floor function on your variable value definition. This will remove any text/date format issues as well as potential timestamp/decimal part issue
    • keep in mind that the floor function should be applied when defining variable as well as in your expression in NPrinitng =Floor(today()-3 )

hope this helps


cheers

Lech

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.