Weekly statistics using while loop.

Hi people i have a situation here: my server generates a statistics text file every 30 mins. i have a script (txt2csv.sh) to convert all the statistics for the day into one csv file. Therefore i am doing a script to auto converts the text files into csv base on a weekly basis.
the script is suppose to be run using this command :
./wklystats 06 11 #base on mm dd
then it should generate a csv for a day one at a time and increase the date numbering by one and generate another csv file until the loop is completed.

#!/bin/sh

SCRIPTNAME=`basename $0`


show_help ()
{
    echo "Usage: $SCRIPTNAME [input month, mm] [input day, dd]"
    echo "This file is used to generate weekly statistics"
    echo ""
}

if [ $# != 2 ]; then
    show_help
    exit 1
fi

dateday=${2}
inputname="statistics-2007"${1}$dateday"-*"
outputname="statistics-2007"${1}$dateday".csv"


i=1
while [ $i -le 7 ]
do

        ./txt2csv.sh $inputname $outputname
        dateday=$(( dateday + 1))
        i=$(( i+1))

done

No question, no answer.

hmmm.. sorry

anyway my code is not working its is not adding up the date producing the right output.

For the date calculation problem, read this thead Yesterdays Date/Date Arithmetic

Thanks aigles