Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Strange sorting problem in the select
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00546825
Message ID:
00546828
Vues:
16
Ok, I changed my statement to
select towns.fullname, towns.Town , towns.ccode, 'Current' as SortOrder ;
			from towns ;
			where towns.Town = BldMstr.Town ;
			union ;
			select towns.fullname, PostRegn.joiningtwn as Town, towns.ccode, ;
			'New   ' as SortOrder ;
			from PostRegn, towns ;
			where PostRegn.joiningtwn = towns.Town and PostRegn.Town = BldMstr.Town ;
			order by 4 ;
			into cursor tRegion
and it solved the problem.

>Hi everybody,
>
>I have the following code in form.Activate (I hide and activate this form multiple times):
>
>.cmbRegions.rowsource=''	
>		select towns.fullname, towns.Town , towns.ccode ;
>			from towns ;
>			where towns.Town = BldMstr.Town ;
>			union ;
>			select towns.fullname, PostRegn.joiningtwn as Town, towns.ccode ;
>			from PostRegn, towns ;
>			where PostRegn.joiningtwn = towns.Town and PostRegn.Town = BldMstr.Town ;
>			into cursor tRegion
>			
>		.cmbRegions.rowsource='tRegion'
>		.cmbRegions.listindex=1
>
>I want the current BldMstr.town to be the first item in this combo and I want it to be displayed. However, it seems like this cursor sorted somehow differently. Do you see a reason, why the first item in union is not the first selected?
>
>I've just thought about a cure for this problem (add a new sorted field), however, it still seems strange to me.
>
>Thanks in advance.
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform