Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Microsoft Progress Bar SP6
Message
From
30/07/2003 06:41:47
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Miscellaneous
Thread ID:
00814827
Message ID:
00814845
Views:
9
>Thanks Neil,
>
>I have created the Method and you code works fine. Due to me being a novice with Foxpro how can I adapt this into my code below:
>
>
>SET EXCLUSIVE off
>SET DELETED ON
>SET DEFAULT TO U:\Data
>USE modacad
>SELECT modacad
>
>LOCAL lctotal, lcsample, lctechnical, lcseason, lcdept, lcdesigner
>
>IF thisform.combo1.DisplayValue = 'ALL'
>	lcseason = ' and ' + 'modacad.key1=""'
>	ELSE
>	lcseason = ' and ' + 'modacad.key1=thisform.combo1.DisplayValue'
>ENDIF
>
>IF thisform.combo2.DisplayValue = 'ALL'
>	lcdept = ' and ' + 'modacad.key2=""'
>	ELSE
>	lcdept = ' and ' + 'modacad.key2=thisform.combo2.DisplayValue'
>ENDIF
>
>IF thisform.combo3.DisplayValue = 'ALL'
>	lcdesigner = ' and ' + 'modacad.moc014=""'
>	ELSE
>	lcdesigner = ' and ' + 'modacad.moc014=thisform.combo3.DisplayValue'
>ENDIF
>
>COUNT FOR modacad.key4='SAMPLE' &lcseason &lcdept &lcdesigner TO lcsample
>COUNT FOR modacad.key4='TECHNICAL' &lcseason &lcdept &lcdesigner TO lctechnical
>COUNT FOR modacad.key4<>'ZZZZ' &lcseason &lcdept &lcdesigner TO lctotal
>
>thisform.text1.Value = lcsample
>thisform.text2.Value = lctechnical
>thisform.text3.Value = lctotal
>thisform.text4.Value = lctotal - (lcsample + lctechnical)
>
>
>Many Thanks

Neil,
You're saying it's taking time and doing it 3 times when one is enough ?
set talk on && Provide progress bar if needed
select ;
  sum(iif(key4='SAMPLE',1,0)) as TotSample, ;
  sum(iif(key4='TECHNICAL',1,0)) as TotTech, ;
  sum(iif(key4#'ZZZZ',1,0)) as Total ;
  from myTable ;
  where .t. &lcseason &lcdept &lcdesigner ;
  into array arrTotals
set talk off

thisform.text1.Value = arrTotals[1]
thisform.text2.Value = arrTotals[2]
thisform.text3.Value = arrTotals[3]
thisform.text4.Value = arrTotals[3] - (arrTotals[1] + arrTotals[2])
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform