>>very similar, just made it faster by including a date in the where but it still takes a couple of seconds when selecting out for each group and that is on my laptop with local files that are less that 50% of the size of the live files. what exactly i need is something like
>>
>>sele sum(net_total) as ytdtotal ;
>>for year(invoice_date) = thisyear, ;
>>sum(net_total) as mtdtotal ;
>>for month(invoice_date) = thismonth and ;
>>year(invoice_date) = thisyear....;
>>for last year as well... group by customer_ref where customer_group = group1
>>
>>and then of course do that for every group, about 20 in total. going to call it a night now but its going to bug me
>>~M
>>
>
>Mark,
>
>Put in the where clause the biggest date range (e.g. from last year to this year and put conditions into iif for each sum).
>
>Another techinique is described in VFP Code Focus
>
http://www.code-magazine.com/focus/vfp/>
>check the first article.
>
>Sorry, really have to run now.
>
>Best of luck!
I meant
http://www.code-magazine.com/focus/Article.aspx?quickid=0404022 (look at page 2 in the article).
If it's not broken, fix it until it is.
My Blog