small problem and can't seem to figure it out and would love help
Code below shows a link from one of my tables my problem is I have found a case where the withdrawn week is considerably greater than the end week which shouldn't be the case.
To cater for this I was wondering can you say coalesce these two values but whatever value is less (except NULL) display that value instead bearing in mind that I need to subtract 1 from the value withdrawn week. I think I need coalesce because alot of the times withdrawn week can be null - maybe there is another way to do this im not sure?
and ( (a.week_no >= b.starting_week)
and (a.week_no <= (coalesce (b.withdrawn_week -1, b.end_week))) )