Choosing what information to filter from SQL in VBA

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

I have recorded a macro that connects to the SQL warehouse for a specific
ClientID.

Is it possible to alter the VBA so that I can choose what ClientID I want to
retrieve? I was thinking of using an input box
 
Hello,

I have recorded a macro that connects to the SQL warehouse for a specific
ClientID.

Is it possible to alter the VBA so that I can choose what ClientID I want to
retrieve? I was thinking of using an input box

Hi
A bit vague
Is the ClientID a text string, a number...
Is the ClientID on a worksheet, in a database, a parameter in another
sub, part of an SQL string...

At the moment, the answer to your question is "yes, probably"
regards
Paul
 
ClientID is a text string in an SQL server table.

Here is the SELECT statement from the VBA


"SELECT Account.AccountID, Account.ClientID, Account.Forename,
Account.Surname, Account.Address1, Account.PostCode, Account.DateOfBirth,
Account.AccountStatus FROM Warehouse.dbo.Account WHERE
Account.ClientID='FTC001'"
 
Ive done it.



Hi
A bit vague
Is the ClientID a text string, a number...
Is the ClientID on a worksheet, in a database, a parameter in another
sub, part of an SQL string...

At the moment, the answer to your question is "yes, probably"
regards
Paul
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top