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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

last year from current date

Status
Not open for further replies.

DemonBOCR

Technical User
Nov 20, 2008
5
US
I am making a report and stuck at this point. Any help would be appreciated.

- My Calendar column includes data from past 2 years till the current date. In the report, I want to only pull data of one year which includes last month from current date. For example, if current date is november 20, 2008 , then i want to include the year from 1st November 2007 to 31 October 2008. I am working on Business Objects Infoview XIR3.1 and can not change objects/class or can not use prompts. Can only work with variables.

Thank you much.
 
Try this

{table.date} in [dateserial(year(currentdate),month(currentdate) - 12,1) to dateserial(year(currentdate),month(currentdate),1-1)]

-lw
 
I tried it but unfortunately it is not working. Any other Idea ?
Thank you verymuch,
Demon
 
Can you provide further detail as to why it did not work?

It worked for me. What were the results of Database Expert -> Show SQL Query

This is what I have in my Record Selection

{IMPOUND.DATE_OF_IMPOUND} in [dateserial(year(currentdate),month(currentdate) - 12,1) to dateserial(year(currentdate),month(currentdate),1-1)]

And here's the results of my SQL

SELECT "IMPOUND"."DATE_OF_IMPOUND"
FROM "EJSDBA"."IMPOUND" "IMPOUND"
WHERE ("IMPOUND"."DATE_OF_IMPOUND">={ts '2007-11-01 00:00:00'} AND "IMPOUND"."DATE_OF_IMPOUND"<{ts '2008-11-01 00:00:00'})


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top