Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to SQL this data
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00667033
Message ID:
00667050
Vues:
15
The trick here is to set the decimals correctly so the output is formatted as you expect. Here is the code:

LOCAL lCurrentDec
lCurrentDec=SET("Decimals")
SET DECIMALS TO 0
SELECT name,PADL(MIN(VAL(item)),5,"0") as "Start", ;
PADL(MAX(VAL(item)),5,"0") as "End" ;
FROM MyTable ;
GROUP BY name ;
into CURSOR curMyTable
SET DECIMALS TO &lCurrentDec

>Hello all
>
>I have the data in following order
>
>Name Item
>---- ----
>
>Admin 00001
>Admin 00003
>Admin 10004
>Admin 10040
>EDP 10000
>EDP 10002
>EDP 10005
>Admin 21222
>Admin 23233
>Admin 32334
>
>How to get the result in this order
>
>Name Start End
>-----------------------------
>Admin 00001 10040
>EDP 10000 10005
>Admin 21222 32334
>
>Txs
-----------------------------------------

Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.com
www.prenia.com
Weblog: blogs.prenia.com/cathi
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform