Sorry, guys. I just noticed that in the function and the select statement at the end, the table is called days_area instead of DaysArea. I had started to edit my code to change the names back to the original but then changed my mind. I thought I had undid all the changes, but I missed this one.
I've edited the post so this only applies if you got to it before I fixed it.
Tomm
PS: So why did I change the names in the first place you ask? To make everything less confusing, of course!
Tomm Carr
--
Version Normal Form -- http://groups.google.com/group/vrdbms