Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Select sql result
Message
 
 
À
26/05/2011 07:02:07
Mk Sharma
Shrishti Solutions
Mumbai, Inde
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01511706
Message ID:
01511819
Vues:
46
>after some correction now it is working
>
>your code
>
>
>SELECT sales.billno,sales.billdt, sales.accode, acmast.acname, acmast.opamt, sales.qty, sales.amt, cast(0 as I) as idTemp ;
>FROM sales ;
>LEFT JOIN acmast ON sales.accode=acmast.accode INTO CURSOR tempcurs READWRITE 
>
>update tempcurs set idTemp = recno()
>select acname, min(idTemp) from tempCurs into filtCurs group by 1
>update tempcurs set opamt = 0 where idTemp not in ;
>  Select idTemp from FiltCurs 
>
>
>
>Code after Correction
>
>
>SELECT sales.billno,sales.billdt, sales.accode, acmast.acname, acmast.opamt, sales.qty, sales.amt, cast(0 as I) as idTemp ;
>FROM sales ;
>LEFT JOIN acmast ON sales.accode=acmast.accode INTO CURSOR tempcurs  ORDER BY 3 READWRITE 
>
>update tempcurs set idTemp = recno()
>select acname, min(idTemp) as idTemp from tempCurs into CURSOR filtCurs group by 1
>update tempcurs set opamt = 0 where idTemp not in ;
>  (Select idTemp from FiltCurs )
>  
>  SELECT tempcurs 
>  BROWSE 
>
>
>warm regards,
>mk.

This will work only for the same account. If you have multiple accounts and want to show the top value for each account, it will not work.
If it's not broken, fix it until it is.


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

Click here to load this message in the networking platform