Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problems Exporting To Excel

Status
Not open for further replies.

memkam

Technical User
Aug 3, 2004
40
US
Hello all,

I have a few queries that I am able to export to excel. However, with one of them, When I export the query it just gives me the header row and no data. In Datasheet view the data is displayed.

Query Looks Like this:

SELECT DISTINCTROW SHA.*
FROM SoftwareListing AS SHA, SoftwareDetails AS SHD
WHERE
(SHA.ProductNumber Not in (select ProductNumber from SoftwareDetails)) AND
(SHA.ProductNumber Not in (select ProductNumber from SoftwareExceptions));

Thanks!
 
Have you tried something like this ?
SELECT SHA.*
FROM (SoftwareListing AS SHA
LEFT JOIN SoftwareDetails AS SHD ON SHA.ProductNumber = SHD.ProductNumber)
LEFT JOIN SoftwareExceptions AS SHE ON SHA.ProductNumber = SHE.ProductNumber)
WHERE SHD.ProductNumber Is Null AND SHE.ProductNumber Is Null;

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
PHV,

I think you missed a bracket and I don't know how the 2 joins are beig combined?

Thanks,

m.
 
Sorry for the typo:
SELECT SHA.*
FROM ((SoftwareListing AS SHA
LEFT JOIN SoftwareDetails AS SHD ON SHA.ProductNumber = SHD.ProductNumber)
LEFT JOIN SoftwareExceptions AS SHE ON SHA.ProductNumber = SHE.ProductNumber)
WHERE SHD.ProductNumber Is Null AND SHE.ProductNumber Is Null;

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top