Topic: end of year for weekly report Posted: 22 Aug 2012 at 4:45pm
hello,
I created crystal report that has formula {date column} in yeartodate. This runs weekly with current yrs data.
But at the end of yr, say 1st Jan falls on wednesday and this report run next week, I wish to have not just data from 1st Jan but Monday(30th Dec), Tuesday(31st Dec). And After 1st week into new yr, I wish to keep formula as above. Will below formula work? {date column} in YearToDate or If DatePart ("ww",{date column},crFirstfullweek) = 1 then {date column} in LastFullWeek
Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Posted: 23 Aug 2012 at 3:50am
You don't need the IF statement - just use {date column} in YearToDate or {date column} in LastFullWeek
If you're not on the first week in the year, the date will be in YearToDate AND LastFullWeek, so this won't include any "extra" dates except when you in the first week of the year. Make sense?
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Posted: 23 Aug 2012 at 5:38am
use the OR in the select statement.
I beleive that Dell was explaining that a row might meet both conditions (this and that) and it would still be included but it should never result in more rows than you intended.
Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Posted: 23 Aug 2012 at 5:40am
That's correct - the syntax in the command is OR, but the explanation of what's happening is that some dates will meet both conditions and, during the first week of the year, some dates will only meet the LastFullWeek condition.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum