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: 
a1exand3r
Contributor III
Contributor III

Filter Date Today-1

Hello,

i want to setup a filter based on todays date -1

Why this doesnt work?

thanks in advance

1 Solution

Accepted Solutions
neelamsaroha157
Specialist II
Specialist II

It looks like you are trying this expression in NPrinting.

If yes, then can you try with =Date(now()-1).

You can add the format if your date format is different from default.

View solution in original post

10 Replies
Anil_Babu_Samineni

May be this?

=Date(Today(1)-1)


Or Can you provide more info

Best Anil, 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
a1exand3r
Contributor III
Contributor III
Author

I have dates in a table, so i only want to get the rows with the dates before today.

The Values are like 07.05.2017  ......

Anil_Babu_Samineni

May be these approaches

1) Script

Load * from Table where DateField <= Date(Date#(DateField-1,'DD.MM.YYYY'),'DD-MM-YYYY');

Or

2) From End May be this?

If(DateField <= Date(Date#(DateField-1,'DD.MM.YYYY'),'DD-MM-YYYY'), DateField)

Best Anil, 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
neelamsaroha157
Specialist II
Specialist II

It looks like you are trying this expression in NPrinting.

If yes, then can you try with =Date(now()-1).

You can add the format if your date format is different from default.

neelamsaroha157
Specialist II
Specialist II

Date with your existing format : =Date(now()-1, 'DD.MM.YYYY')

a1exand3r
Contributor III
Contributor III
Author

Thanks, does exactly what i need

neelamsaroha157
Specialist II
Specialist II

Great..

Was it the date format or the function?

a1exand3r
Contributor III
Contributor III
Author

I think now() creates a date in Systemformat so i dont specify the format.

I used now() instead of Today() and it worked for me.

Anonymous
Not applicable

I have the same issue but this solution is not working for me.

I tried with formatting and without formatting. but nothing works with date filter.

i have also tried formatting column in load and in the table. The column in database is of type - datetime

1.png

2.png