The only information I want is the bottom row - the rest is historical data from previous week's and months.
Hope this clears up what I'm looking for.
Many thanks for your reply
03-15-2001, 11:58 AM
Forget about HAVING, use a simple WHERE condition. In your initial example it would be something like:
MAX(DECODE(trunc(Sysdate)-Check_Date , 1 , number, 2, number, 3, number, 4, number, 5, number, 6, number, 7, number )) ThisWeek
WHERE Check_Date IS NOT NULL
group by country, town;
The condition "WHERE Check_Date IS NOT NULL" is sufficient in this case, because only if this is true your expression inside the DECODE ("trunc(Sysdate)-Check_Date") would return NULL.
03-16-2001, 04:06 AM
As always your forums are a great source of information and advice, I look forward to being able to provide help to others in the future.