Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reportnet filter

Status
Not open for further replies.

ramakr1shna

Programmer
Jul 27, 2005
3
US
HI,
Iam building a crosstab report with month details as columns.We have four years of data till date but i have to filter the data such that it shows exact past two years from current month.Can somebody help me with this,its urgent
thank you
 
What data type is your month column? Is it being derived from a date eg 01/01/2004, or is it stored as a char field (something like 200401)?

 
Have you tried something like:

For Oracle database:
[Mydatefiled] >= add_months({sysdate}, 0 - 24 )

For the add_months, I noticed that reportnet doesn't allow -12, so the way around is to do 0-24.

This will show only the figures for the 24 past months and future dates also.
If you want exactly the past 24 months, do .
[Mydate] between add_months({sysdate}, 0 -12 ) AND {SYSDATE}
 
Have you tried something like:

For Oracle database:
[Mydatefiled] >= add_months({sysdate}, 0 - 24 )

For the add_months, I noticed that reportnet doesn't allow -12, so the way around is to do 0-24.

This will show only the figures for the 24 past months and future dates also.
If you want exactly the past 24 months, do .
[Mydate] between add_months({sysdate}, 0 -24 ) AND {SYSDATE}
 
Hi Thank you everybody for valuable answers.My Data format is yyyymm and its a varchar.I tried all the solutions you guys have told me,its not showing any errors when i validate it but its not showing the required data....its showing everything till date...any other ideas please..its a oracle database
thank you
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top