Page 1 of 1

InRange

Posted: Mon Mar 01, 2004 8:42 am
by TIM
Good day all____I wonder if someone could point me in the right direction as I am drifting aimlessly in circles :-(____The report I am wrighting has the task of stating how many drops were done in a period for a particular group of customers. The deliveries are stored in same_del.dbf and the associated drops are drop.dbf there can be as many as 50 drops or as few as 2.____the report is indexed by group + order date and the index is repeted as group fields in the report.____on the report there is a group footer for "Group" and a summary for the total of all drops for all groups over the period.____The problem is that the count of drops is way out, in my test period i have added two deliveries each with 2 drops,so i was expecting an answer of 4 when I previewed the report however it came back with 40?____I added a record line to try and figure out what it is returning, and it lists the first entry correctly then gives extra drops to various deliveries none of which are in the range specified in the condition on the total field.____The total field is a count of count_drop by group, automatic, running. i tried fiddling with the in range statement to no avail, it currently reads__INRANGE(DTOC(SAME_DEL->ORD_DATE,1),"1999401","20000331")____Count_drop reads, IIF(drop->con_noteno AND Drop_no,.t.,.f.)____have I given enough info? if not ask away, :-) any help gratefully received. ____Thanks in advance____Tim______

=> RE: InRange

Posted: Mon Mar 01, 2004 9:08 am
by Bridgetjuime
Change the total from a count to a sum.__A sum will add 1 for each true value where a count will count the number of valid values whether they be true or false.____Kathleen__R&R Support

==> RE: InRange

Posted: Tue Mar 02, 2004 6:04 am
by TIM
Hi Kathleen____Nice try but sadly not. ____your of course correct I should have summed the count_drop field, so I changed that and I still get 40. I added the record line back in and the result is most strange, if i add a job with 2 drops this shows correctly, then I add a second job with two drops, the first job still lists correctly then it gets silly the second job list with 14 drops, the third job with 24 drops, ____the stupid thing is that in drop.dbf there is a field call drop_no not supprisingly it show the drop number and when you look in the database the drops 3-14 & 3-24 just don^t exist. ____I think I might recreate the date and see if that^s the issue, unless you can think of anything else?____Thanks for you help ____Regards____Tim__

===> RE: InRange

Posted: Tue Mar 02, 2004 5:55 pm
by kfleming
It sounds like the relation between the tables is not working correctly. Check that you have selected the appropriate linking field and related file index and that the index is correct and up to date.____Kathleen__R&R Support

====> RE: InRange

Posted: Wed Mar 03, 2004 6:11 am
by TIM
Good day Kathleen,____it seems we might be on the right trail, when I checked the relationship initally i got a shut down error, so i restarted and went back in and now i get an Internal File Setup Error, Help says to contact you guys :-( ____Regards____Tim

=====> RE: InRange

Posted: Wed Mar 03, 2004 10:06 am
by TIM
Hi Again____Sigh, I wish I understood computers.____Checked the index and relationship both 100% sound.____Recreated the data and the origional report still does not work.____started a fresh report and put in the calculation that^s been causing all the trouble and it^s 100% fine. ____well lets look on the bright side it works now LOL____Thanks for the help :-)____Tim__