R&R Xbase crashes
Posted: Wed Dec 08, 2004 11:57 am
Hi all,__I have the following problem: I am trying to change a report that was made by a former worker in my company. Every time whenI start the report is counts the needed values but in the moment where it is done I get an error and R&R simply shuts down :-(____Report^s task: calculate the sales volume for the beginning of the year until a given week. Further it calculates sale volumes for the next 10 weeks. The thing is that I needed to program a piece of code in the report so I will not get an overflow in the count of the weeks. At the moment it is dumb-programmed so you must change it every year so the date will be correct____How does it work?: the person using the report inputs the number of the week and the year (example: 23 or 5) and than the given year (2004 or 2007 etc.) and the report calculates the sales volume for the given weeks. The guy who programed this report didn^t use a real date type, but the week is simply added to the year, example: 200405 is the fifth week in the year 2004, 200853 is the last week in the year 2008...__ __What did I try to do?: I worked on a formula that will find out if the current year is a leap year or not (a leap year has 53 weeks instead of the normal 52 weeks in a year) and than decide which jear and month it should write in each column.____How does it look like?: IIF(MOD(startJahr,4)>0,IIF(startWoc1>52,(startJahr+1)*100+(startWoc1-52),startJahr*100+startWoc1),IIF(startWoc1>53,(startJahr+1)*100+(startWoc1-53),startJahr*100+startWoc1))____And now in words: if the year is not a leap year calculate the right week according to 52 weeks in a year. If the year is a leap year calculate the right week according to 53 weeks in a year. If yo need more information about the code please let me know!____I think I have managed to narrow the problem to my code. The thing is: I don_t know why it is crashes. I_ve looked at it for some time and couldn_t come up with any idea. Anyone got an idea??____Thanks in advance, Dekers______