This might help Rennur.
I am not sure how to get the INT of a number in Aware and a 2 am I am not going to keep searching tonight...however....
I think this is getting pretty close except for cases of less than a week. It will count the number of Sundays between 2 dates.
DemoData.NumberSundays=(DAY_DIFFERENCE(DemoData.SecondDate,DATE_ADD(DemoData.FirstDate,7-DAY_NUMBER_IN_WEEK(DemoData.FirstDate)+1))+1)/7+1
Should be in the form....
DemoData.NumberSundays=INT((DAY_DIFFERENCE(DemoData.SecondDate,DATE_ADD(DemoData.FirstDate,7-DAY_NUMBER_IN_WEEK(DemoData.FirstDate)+1))+1)/7)+1
Still need to do some further testing but might be a start.