Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Select sql result
Message
 
 
To
26/05/2011 07:02:07
Mk Sharma
Shrishti Solutions
Mumbai, India
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01511706
Message ID:
01511819
Views:
45
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform