I have a bit of code that adds figures from sales sheets for given periods.
These periods (week 1, week 2 week 3 etc) are....
Week 1: from the 1st of the month to the first Sunday.
Week 2: from the following Saturday to the following Sunday
and so on, NOTE that the first and last weeks may well be only a few days.
September week 1 would be
*----- 1st week of month to the first Sunday (only 4 days)
store {^2004/09/01} to MDATEA
store {^2004/09/04} to MDATEB
store "01/09/2004 to 04/09/2004" to MDATEC
do enterit
*----- 2nd of month Monday to Sunday
store {^2004/09/05} to MDATEA
store {^2004/09/11} to MDATEB
store "01/09/2004 to 04/09/2004" to MDATEC
do enterit
and so on
MDATEA is the first day, MDATEB is the last day and MDATEC gives me a title
I have to manually change these each month.
Here at last is my question.
How could I set this up to be automatic on, say, the selection of a month and year?
I would like to be able to select a month and year from a menu or similar and have the code work out the weeks.
Thanks in advance.
Ken
These periods (week 1, week 2 week 3 etc) are....
Week 1: from the 1st of the month to the first Sunday.
Week 2: from the following Saturday to the following Sunday
and so on, NOTE that the first and last weeks may well be only a few days.
September week 1 would be
*----- 1st week of month to the first Sunday (only 4 days)
store {^2004/09/01} to MDATEA
store {^2004/09/04} to MDATEB
store "01/09/2004 to 04/09/2004" to MDATEC
do enterit
*----- 2nd of month Monday to Sunday
store {^2004/09/05} to MDATEA
store {^2004/09/11} to MDATEB
store "01/09/2004 to 04/09/2004" to MDATEC
do enterit
and so on
MDATEA is the first day, MDATEB is the last day and MDATEC gives me a title
I have to manually change these each month.
Here at last is my question.
How could I set this up to be automatic on, say, the selection of a month and year?
I would like to be able to select a month and year from a menu or similar and have the code work out the weeks.
Thanks in advance.
Ken