Using a WILDCARD (%) in the SELECT clause

C

cg

Hi All,

I have a table in Access that I am using ADO to connect to in EXCEL. The
table has column headings by month-year (Ex. 01-05,02-05,03-05,04-05, etc.).

Is it possible to have the SELECT statement use a % wildcard to pull columns
that end in the year I specify? For instance, if I only wanted to see 2005
data I would have something like this: SELECT [%%-05] From Oracle so that it
would pull all the columns in the Oracle table that end in 05?

Thanks!!!
 
D

Doug Glancy

Here's the code generated by Access for something similar:

SELECT Table1.test
FROM Table1
WHERE (((Table1.test) Like "*05"));

hth,

Doug
 
T

Tim Williams

Most likely you would need to examine the Field names first, and use that
information to construct your select SQL.

Or just pull all columns and loop through the fields, using only those with
the required headings.

Tim
 

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

Top