If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Last Year YTD

Started by johny.cbi, 24 Apr 2008 12:23:05 PM

Previous topic - Next topic

johny.cbi

I need Last Year YTD

I am trying to get all data less than April 24th, 2007 to start

but its not working

I tried with this syntax

[Date]<=to_date(to_number(to_char({SYSDATE},'YYYY')-1) + '-' + to_char({SYSDATE},'MM-DD'),'YYYY-MM-DD')

not working properly

Thanks for the ideas

almeids

For starters, check your parentheses, and don't rely on implicit type conversion  when you're having a problem since it makes it difficult to read the expression and understand what's going on (at least it does for me...my head hurts just looking at that thing).
If you're going to embark on an extensive nested function exercise, it's helpful to do it in a data item first and include it on your report so you can verify the results, or, if you aren't using any Cognos functions as is the case here, work directly in the database.  Start simple (one function!) then add function wrappers one at a time and work your way outward until you've got the entire expression.
But, before you do that think about what you are doing, review the tools at hand and look for the simplest solution before you start tacking things together a la Rube Goldberg.  So, in this case:
[date]<_add_years({sysdate},-1)