ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   SQL Select Statement in Excel (https://www.excelbanter.com/excel-programming/349447-sql-select-statement-excel.html)

agustina_s

SQL Select Statement in Excel
 

Hi is there anyway to create macro/ VBSCript to execute SQL Selec
statement in Excel Column.

Eg.

Select FirstName where LastName in ('Smith','Anderson')

I have an excel spreadsheet1 with Column A = FirstName and B
LastName
And then in another spreadsheet2 I want to look up value t
spreadsheet1.

Is there any tutorial regarding this?
I tried to search for it but to no avail :S.

Any suggestion is welcome.
Thanks in advanced.

Regards

Agustin

--
agustina_
-----------------------------------------------------------------------
agustina_s's Profile: http://www.excelforum.com/member.php...fo&userid=3009
View this thread: http://www.excelforum.com/showthread.php?threadid=49781


voodooJoe

SQL Select Statement in Excel
 
SQL - depends if they are in the same workbook. if the sheets are in
different workbooks, you can use MS Query to get external data from a closed
Excel workbook (either from the 1st sheet or a named range)

if its in the same workbook, try using an advanced filter they would look
like

FIRST_NAME LAST_NAME
Smith
Anderson

using 2 lines is basically an 'or' statement

you could also use a lookup function if you want to do it within a formula.
a workaround alternative to the SQL "in" statement is FIND where you say

=if(FIND("Smith","Smith,Jones")0,FIRST_NAME,"")

This potentially lets you work within a formula

hope this helps - voodooJoe

"agustina_s" wrote
in message ...

Hi is there anyway to create macro/ VBSCript to execute SQL Select
statement in Excel Column.

Eg.

Select FirstName where LastName in ('Smith','Anderson')

I have an excel spreadsheet1 with Column A = FirstName and B =
LastName
And then in another spreadsheet2 I want to look up value to
spreadsheet1.

Is there any tutorial regarding this?
I tried to search for it but to no avail :S.

Any suggestion is welcome.
Thanks in advanced.

Regards

Agustina


--
agustina_s
------------------------------------------------------------------------
agustina_s's Profile:
http://www.excelforum.com/member.php...o&userid=30094
View this thread: http://www.excelforum.com/showthread...hreadid=497813




Di$cover

SQL Select Statement in Excel
 
Hi,

Try to use VLookup formaulae in excel, hope this helps to lookup the
value.

Warm regards,
Di$c0ver


agustina_s wrote:
Hi is there anyway to create macro/ VBSCript to execute SQL Select
statement in Excel Column.

Eg.

Select FirstName where LastName in ('Smith','Anderson')

I have an excel spreadsheet1 with Column A = FirstName and B =
LastName
And then in another spreadsheet2 I want to look up value to
spreadsheet1.

Is there any tutorial regarding this?
I tried to search for it but to no avail :S.

Any suggestion is welcome.
Thanks in advanced.

Regards

Agustina


--
agustina_s
------------------------------------------------------------------------
agustina_s's Profile: http://www.excelforum.com/member.php...o&userid=30094
View this thread: http://www.excelforum.com/showthread...hreadid=497813



RB Smissaert

SQL Select Statement in Excel
 
Look at my answer to the post of 2 December 2005:
Count duplicates in an array?

RBS


"agustina_s" wrote
in message ...

Hi is there anyway to create macro/ VBSCript to execute SQL Select
statement in Excel Column.

Eg.

Select FirstName where LastName in ('Smith','Anderson')

I have an excel spreadsheet1 with Column A = FirstName and B =
LastName
And then in another spreadsheet2 I want to look up value to
spreadsheet1.

Is there any tutorial regarding this?
I tried to search for it but to no avail :S.

Any suggestion is welcome.
Thanks in advanced.

Regards

Agustina


--
agustina_s
------------------------------------------------------------------------
agustina_s's Profile:
http://www.excelforum.com/member.php...o&userid=30094
View this thread: http://www.excelforum.com/showthread...hreadid=497813




All times are GMT +1. The time now is 05:14 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com