By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,396 Members | 1,422 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,396 IT Pros & Developers. It's quick & easy.

SQL string

P: n/a
Hi

I have a SQL string that works fine in Access.
I am trying to use the string to import the data into Excel.

The string appears to be too long for the VBA editor, has a complex
Where selection with several AND OR statements. Do not seem to be able
to break the Sql statment into blocks that will fit???

Any suggestions??

Thanks

Clive
Aug 19 '08 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On Tue, 19 Aug 2008 04:15:24 -0700 (PDT), Clive Swan wrote:
Hi

I have a SQL string that works fine in Access.
I am trying to use the string to import the data into Excel.

The string appears to be too long for the VBA editor, has a complex
Where selection with several AND OR statements. Do not seem to be able
to break the Sql statment into blocks that will fit???

Any suggestions??

Thanks

Clive
"Import the data into Excel"?
Sounds like you are doing this from Excel, in which case I would
suggest you post this question in an Excel newsgroup.

I would also suggest you include your Excel version number. Sometimes
it makes a difference.

It also seems logical to me that you should include the exact SQL in
your message.
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
Aug 19 '08 #2

P: n/a
Hi Fred

I found an example that solved the problem, quite simple.
Sql = "Select * from ........"

Solution is:
Sql = "Select * from ................"
Sql = Sql & "Where ................."

This worked!!

Thanks

On 19 Aug, 16:15, fredg <fgutk...@example.invalidwrote:
On Tue, 19 Aug 2008 04:15:24 -0700 (PDT), Clive Swan wrote:
Hi
I have a SQL string that works fine in Access.
I am trying to use the string to import the data into Excel.
The string appears to be too long for the VBA editor, has a complex
Where selection with several AND OR statements. Do not seem to be able
to break the Sql statment into blocks that will fit???
Any suggestions??
Thanks
Clive

"Import the data into Excel"?
Sounds like you are doing this from Excel, in which case I would
suggest you post this question in an Excel newsgroup.

I would also suggest you include your Excel version number. Sometimes
it makes a difference.

It also seems logical to me that you should include the exact SQL in
your message.
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
Aug 20 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.