Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL order Problem
Message
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2008
Miscellaneous
Thread ID:
01442212
Message ID:
01442217
Views:
48
>Hi all and happy new year for everbody !
>
>I have a problem for indexing a field ( clocation ) in a sql clause.
>cf picture in the attachment please.
>
>
>I should like "c:\datas\Data1" Before "c:\datas\Data1"
>
>it 'is possible ?
>
>
>
>SET ENGINEBEHAVIOR 90
>SELECT DISTINCT  CAST( ADDBS( UPDATE.clocation ) AS C(50) ) AS clocation , UPDATE.iid ;
> FROM UPDATE WHERE FILE( ADDBS( UPDATE.clocation) + "Id.dbf") AND ;
> FILE( ADDBS(UPDATE.clocation) + "Compagny.dbf") AND ;
> FILE ( ADDBS(clocation) + "Amline.dbc" ) INTO ARRAY Societes
ORDER BY 1
>SET ENGINEBEHAVIOR 70
>
>
>thank in advance for answer.
>
>
>bernhart
CREATE CURSOR t (cLocation C(40))
INSERT INTO t VALUES ('c:\Data1\')
INSERT INTO t VALUES ('c:\Data16\')
INSERT INTO t VALUES ('c:\Data16g\')
SELECT cLocation,SUBSTR(cLocation,1,LEN(ALLTRIM(ADDBS( clocation ))) - 1) as SortOrder FROM t ORDER BY 2
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform