Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 418
  • Last Modified:

Date formula that goes back 5 years

Hello Experts,
Is there a way to create a date formula that will pull records from the current date back 5 years?  The formula should look at a date time field on the report and retrieve records that go back 5 years from the current date. The report is querying an Oracle database. Any suggestions?  Thanks.
0
jsmith08
Asked:
jsmith08
  • 4
  • 3
1 Solution
 
mlmccCommented:
Use the SELECT EXPERT

{DateField} >= DateAdd('yyyy'-5,CurrentDate)

mlmcc
0
 
jsmith08Author Commented:
Thanks...
I used the following formula:
{CASE.FILE_DT} >= DateAdd('2010'-5,CurrentDate)
and I get the error message that "A number, currency amount, date, time, or date-time is required here."
0
 
mlmccCommented:
Where do you get that?

You have to add that to the selection filter
REPORT --> SELECT EXPERT

mlmcc
0
Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

 
jsmith08Author Commented:
Yes, I did add it to the select expert and that's the error that comes up
0
 
mlmccCommented:
i see the issue.

Don't use 2010 use yyyy
You are telling dateadd to add years

mlmcc
0
 
mlmccCommented:
Sorry I missed a comma

{DateField} >= DateAdd('yyyy',-5,CurrentDate)

mlmcc
0
 
jsmith08Author Commented:
Thank you. This works perfectly.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now