Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
cg cg is offline
external usenet poster
 
Posts: 11
Default Using a WILDCARD (%) in the SELECT clause

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!!!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 770
Default Using a WILDCARD (%) in the SELECT clause

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

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

hth,

Doug

"cg" wrote in message
...
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!!!



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,588
Default Using a WILDCARD (%) in the SELECT clause

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

"cg" wrote in message
...
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!!!



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can I use a between clause or in clause on an IF statement ssciarrino Excel Programming 2 May 4th 07 04:48 PM
select all worksheets in formula (wildcard) Leif Excel Worksheet Functions 3 May 12th 06 09:52 PM
IF Clause juergenkemeter[_2_] Excel Programming 6 January 10th 06 11:17 PM
VBA: Select Excel's Worksheet using wildcard maxifire Excel Programming 5 December 15th 03 04:21 PM
Wildcard character with Select Statement Mike Excel Programming 1 December 12th 03 07:21 PM


All times are GMT +1. The time now is 11:49 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"