Link to home
Start Free TrialLog in
Avatar of discogs
discogs

asked on

sql vba excel 2010 ado query syntax

Hello EE,

I am having an issue getting my records out of an table in excel 2010 using ado.

This statement returns 146 records fine:

rst.Open "SELECT [IndexKey], [Details], [Name], [Amount], [Name] FROM [tbl_import] ORDER by [Name]", cnn, adOpenStatic

Open in new window


As soon as I add some criteria, it does not:

rst.Open "SELECT [IndexKey], [Details], [Name], [Amount], [Code] FROM [tbl_import] WHERE ((([Code]) Is Null)) ORDER BY [Name]", cnn, adOpenStatic

Open in new window


Anyone got the solution? Its got me stumped!

TA
ASKER CERTIFIED SOLUTION
Avatar of PortletPaul
PortletPaul
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of discogs
discogs

ASKER

Paul
Thanks for your response.

Interesting points you make. I ran a test against the cell and realised that there is a formula inside there which is why its not returning any records.

Thanks for the tip, I am going to have to approach this a different way.

TA