Link to home
Start Free TrialLog in
Avatar of PresidentLincoln
PresidentLincolnFlag for United States of America

asked on

DB2: Pulling YTD data on the first of the year

We have several Crystal Reports that use DB2 (AIX) queries as the backend of the report.  They are year-to-date reports that, when run, show all days from 01/01 of that year through the date the report is run.  I use something simple like this:

YEAR(column) = YEAR(current_date)

Open in new window


The problem is that, if the report is run on 01/01 of the next year, it has no data because  it's only reporting on the first day of that new year.  How can I get it to report on the previous year's data if run on the first week of the new year instead?
ASKER CERTIFIED SOLUTION
Avatar of Kent Olsen
Kent Olsen
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of PresidentLincoln

ASKER

Thanks @Kent.  This will definitely work.