Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Possible in one SELECT command?
Message
 
To
01/11/2005 05:58:55
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01063783
Message ID:
01064307
Views:
15
Fabio
1) Why no good? Wrong data result or just too "slow"? ( i tested the result with over 100 lines and the data is correct
2) I understand this code much better than the other one ( in fact now i understand what you did there ). I'll run it too and compare the 2 resulting mytesttable to see if there is any difference.

Molto grazzie
Jaime

>>Bingo!!
>>This one works perfectly, and in 1.82 seconds by the way.
>>A million thanks again, Fabio
>>Jaime
>>
>NO GOOD.
>
>TRY
>
>* phase 1 : grouping info
>SELECT  ;
>	DOW(Date)	dateW		;
>,				Shaa		;
>,				PCode		;
>,	Oper		rowGroupNum	;	&& Oper must to be a INTEGER
>	INTO CURSOR tempPhase1 READWRITE;
>	FROM Yoman	;
>	ORDER BY 1,2
> &&	WHERE Date between m.lStartDate AND m.lStartDate+3 AND  Bit NOT IN ("ì", "ð", "á" )	AND	m.RofeCode IN (  M1,  M2,  M3,  M4 )
>
>* this numbers the rows of every group
>PRIVATE dateW,Shaa
>DO WHILE NOT EOF()
>	SCATTER FIELDS dateW,Shaa MEMVAR
>	REPLACE WHILE dateW=m.dateW AND CTime==m.Shaa rowGroupNum WITH _TALLY
>ENDDO
>RELEASE dateW,Shaa
>
>* final group transposition
>SELECT T.Shaa	;
>,  MAX( IIF(dateW=1, Patient.Shem+Sug+left(NVL(SugTip.SugTipul,"  "),2) ,SPACE(28))) AS Sunday ;
>,  MAX( IIF(dateW=2, Patient.Shem+Sug+left(NVL(SugTip.SugTipul,"  "),2) ,SPACE(28))) AS Monday;
>,  MAX( IIF(dateW=3, Patient.Shem+Sug+left(NVL(SugTip.SugTipul,"  "),2) ,SPACE(28))) AS Tuesday ;
>,  MAX( IIF(dateW=4, Patient.Shem+Sug+left(NVL(SugTip.SugTipul,"  "),2) ,SPACE(28))) AS Wednesday ;
>FROM tempPhase1 T;
>LEFT JOIN Patient ON T.PCode=Patient.Code ;
>LEFT JOIN Sugtip  ON T.Tipul=SugTip.Code ;
>GROUP BY Shaa , rowGroupNum ;
>INTO TABLE mytesttable
>USE IN tempPhase1
>
Why do programs stop working correctly as soon as you leave the Fox?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform