Oh wow, that looks great. Why is telling me that a Boolean is Required Here?
//{@July days}:
datevar st := {table.startdate};
datevar end;
numbervar jul;
if st < date(2011,7,1) then
st := date(2011,7,1) else
if st >= date(2011,8,1) then
st := date(0,0,0) else
st := st;
if...