Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Last transaction of each transaction type
Message
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2003 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01508934
Message ID:
01508961
Views:
32
Thanks again Sergey

so I should have been going a JOIN ON, gotcha

SQL is soooo powerful, I only need to touch the surface but can see what a useful laungage it is

Awesome!


So far my code is:
SELECT type,desc,* FROM wipdata!logfile tl   WHERE  Date  =  (SELECT MAX(date)  FROM logfile WHERE Jobno = tl.Jobno AND Type = tl.Type) into cursor tmptrans
So to look up the employees/operators name from another table in SQL I would usually do something like this:
SELECT *,CNAME FROM wipdata!logfile,wipdata!operators where OPERATOR=NEMPNO into cursor tmptrans
How do I insert the above into my code so far, as soon as I add wipdata!operators
into the syntax that seems to mess up my grouping and I don't just get the last
record for each type?

Give us a clue... LOL


>Why not?
>
>>
>>So if I use:
>>
>>
SELECT * FROM TranLog tl
>>  WHERE Jobno = "..." AND
>>      TranDate  =  (SELECT MAX(TranDate)  FROM TranLog WHERE Jobno = tl.Jobno AND TranType = tl.TranType)
>>
>>as a final requirement I want to fill in the employees name, field is NEMPNO I(4), AND CNAME C(20) is stored in
>>OPERATORS & indexed on IEMPNO
>>
>>is this possible within the same SQL statement?
>>
>>
Rob
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform