PC Review


Reply
Thread Tools Rate Thread

ADO SQL syntax query, using a variable

 
 
=?Utf-8?B?U3Bpa2U=?=
Guest
Posts: n/a
 
      8th Mar 2007
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 With Quote
 
 
 
 
NickHK
Guest
Posts: n/a
 
      8th Mar 2007
Spike,
Try:
"SELECT .... WHERE fund=" & Chr(34) & fundname & Chr(34)

NickHK

"Spike" <(E-Mail Removed)> wrote in message
news:B0BB0CBF-9A6A-4EE0-AE62-(E-Mail Removed)...
> 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 With Quote
 
=?Utf-8?B?U3Bpa2U=?=
Guest
Posts: n/a
 
      8th Mar 2007
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" <(E-Mail Removed)> wrote in message
> news:B0BB0CBF-9A6A-4EE0-AE62-(E-Mail Removed)...
> > 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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Variable Syntax Minitman Microsoft Excel Programming 8 26th May 2008 04:18 PM
ASP Syntax using Variable for DropDownList1 as criteria in Pervasive SQL query bryant@4dnssupport.com Microsoft ASP .NET 7 6th May 2007 03:35 PM
syntax for variable =?Utf-8?B?YWRhbWFhZ2FyZA==?= Microsoft Excel Programming 2 20th Jan 2006 12:45 AM
Syntax for a Variable =?Utf-8?B?TGxveWQ=?= Microsoft Access Form Coding 1 6th Apr 2005 08:44 PM
Syntax of like statement using a variable Brad Tornberg Microsoft Access VBA Modules 1 18th Aug 2004 09:14 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:37 AM.