Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 140
Default ADO SQL syntax query, using a variable

I need to extract data from a csv file for a specific fund, i have the syntax
to do this by coding the fund name into the SQL string, but what is the SQL
statement syntax to use if you wish to use a variable to hold the fund name.
So instead of ....WHERE fund = 'XYZ'. i have tried WHERE fund= fundname.
Fundname being the variable holding the fund name. This produces an error.

I will be very grateful for any help in this
--
with kind regards

Spike
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default ADO SQL syntax query, using a variable

Spike,
Try:
"SELECT .... WHERE fund=" & Chr(34) & fundname & Chr(34)

NickHK

"Spike" wrote in message
...
I need to extract data from a csv file for a specific fund, i have the

syntax
to do this by coding the fund name into the SQL string, but what is the

SQL
statement syntax to use if you wish to use a variable to hold the fund

name.
So instead of ....WHERE fund = 'XYZ'. i have tried WHERE fund= fundname.
Fundname being the variable holding the fund name. This produces an

error.

I will be very grateful for any help in this
--
with kind regards

Spike



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 140
Default ADO SQL syntax query, using a variable

Works like a dream thank you so much
--
with kind regards

Spike


"NickHK" wrote:

Spike,
Try:
"SELECT .... WHERE fund=" & Chr(34) & fundname & Chr(34)

NickHK

"Spike" wrote in message
...
I need to extract data from a csv file for a specific fund, i have the

syntax
to do this by coding the fund name into the SQL string, but what is the

SQL
statement syntax to use if you wish to use a variable to hold the fund

name.
So instead of ....WHERE fund = 'XYZ'. i have tried WHERE fund= fundname.
Fundname being the variable holding the fund name. This produces an

error.

I will be very grateful for any help in this
--
with kind regards

Spike




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
syntax - range name as a variable Peter Morris Excel Programming 3 August 4th 06 07:09 PM
SQL query syntax Wim[_2_] Excel Programming 10 May 20th 06 09:49 PM
syntax for variable adamaagard Excel Programming 2 January 20th 06 12:45 AM
DB query syntax Mike Fogleman Excel Programming 5 December 19th 03 09:42 AM
Syntax for variable search brym Excel Programming 0 August 6th 03 05:41 PM


All times are GMT +1. The time now is 09:33 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"