Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Statement
Message
From
07/02/2011 21:53:43
James Blackburn
Qualty Design Systems, Inc.
Kuna, Idaho, United States
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows XP
Database:
MySQL
Miscellaneous
Thread ID:
01499047
Message ID:
01499116
Views:
32
MySql can't have a semicolon (;) in the script. Try this.
lnResult=SQLEXEC(mConn,"Select T1.* From Inv T1 Inner Join (Select Itm_Code, MAX(Date) as LastDate From Inv Group by Itm_Code) T2 " ;
+" on T1.Itm_Code = T2.Itm_Code and T1.Date = T2.LastDate")
>>If I run this query on VFP Table then the result is OK and If on MySql Table then there is no result
>>
>>MySql Query is as under:
>>= SQLEXEC(mConn,"Select T1.* From Inv T1 Inner Join (Select Itm_Code, MAX(Date) as LastDate From Inv Group by Itm_Code) T2 ;
>>on T1.Itm_Code = T2.Itm_Code and T1.Date = T2.LastDate")
>>
>>Rgds:
>>Ahsan Rana
>
>I'm not sure why it will not give your result in MySQL. May be the JOIN based on date is failing for some reason? What if you only do inner select in MySQL?
>Also, remove ; after T2 in MySQL
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform