Question : SQL Data Connection from Excel 2007

I am now connecting to SQL tables from inside Excel using Data -> External Connections.  Previously, those SQL tables were FoxPro tables.  The SQL connection text which worked with the VFP tables (using the VFP format for external connections) does not work with SQL tables directly.

This is one of the former connection texts which worked with VFP:

SELECT (alltrim(intran.fpartno)+" / "+alltrim(intran.fcpartrev)), Sum(intran.fqty*(-1))
FROM intran intran
WHERE (intran.type = 'I') AND (intran.fdate>={d '2005-12-31'})
GROUP BY intran.fpartno,intran.fcpartrev

What I need to do now is connect from inside Excel to the external SQL table and execute SQL commands that will do what the ones above did when connected to the VFP table.  I am using MS SQL Server 2005. The intran table has over 500,000 records in it. The only Excel-to-dbf utility I have will not work with Excel 2007 (xlsx) files--longer than 65K rows. What SQL commands do I enter in the command text tab to accomplish this when connected to a SQL table?

Glenn

Answer : SQL Data Connection from Excel 2007

This command should work

SELECT (ltrim(rtrim(intran.fpartno))+" / "+rtrim(ltrim(intran.fcpartrev))), Sum(intran.fqty*(-1))
FROM intran
WHERE (intran.type = 'I') AND (intran.fdate>= '2005-12-31')
GROUP BY intran.fpartno,intran.fcpartrev
Random Solutions  
 
programming4us programming4us