ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   SQL.REQUEST help needed (https://www.excelbanter.com/excel-worksheet-functions/23835-sql-request-help-needed.html)

mr.bungle

SQL.REQUEST help needed
 
Having trouble trying to pull info into Excel from an Access table.

The last element of the SQL.REQUEST function is SELECT Client FROM
tblProject WHERE (ProjectRef=$A$1)

When $A$1 is an integer the function works ok, but I can't get it to
look for a text string. Is this a limitation of the function?

Any help appreciated.

mrb.

Alok

When the field in access is a text field, you have to encolse the value in
single or double quotes as follows
tblProject WHERE (ProjectRef= & chr(34) & $A$1 & chr(34))

Note chr(34) is equivalent to a double quote.
Alok

"mr.bungle" wrote:

Having trouble trying to pull info into Excel from an Access table.

The last element of the SQL.REQUEST function is SELECT Client FROM
tblProject WHERE (ProjectRef=$A$1)

When $A$1 is an integer the function works ok, but I can't get it to
look for a text string. Is this a limitation of the function?

Any help appreciated.

mrb.


Andy Wiggins

This file gives general help on the use of SQL.REQUEST. It might help:
http://www.bygsoftware.com/examples/...SqlRequest.zip
It's in the "Excel with Access Databases" section on page:
http://www.bygsoftware.com/examples/examples.htm

This workbook demonstrates how to get data direct from an MS Access table,
or from an open or closed MS Excel workbook using the workbook function
SQL.REQUEST.

Recently updated to show the use of SQL.REQUEST in the same workbook.

The code is open and commented.


--
Regards
-
Andy Wiggins FCCA
www.BygSoftware.com
Excel, Access and VBA Consultancy



"mr.bungle" wrote in message
. ..
Having trouble trying to pull info into Excel from an Access table.

The last element of the SQL.REQUEST function is SELECT Client FROM
tblProject WHERE (ProjectRef=$A$1)

When $A$1 is an integer the function works ok, but I can't get it to
look for a text string. Is this a limitation of the function?

Any help appreciated.

mrb.





All times are GMT +1. The time now is 02:32 PM.

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