#1   Report Post  
Excel GuRu
 
Posts: n/a
Default Microsoft Query

I'm querying external data from Excel using Microsoft Query. I'm querying an
oracle database. I'd like to limit the amount of records that come accross
so the file is easier to manage. We have 9 digit sales part numbers. Each
digit has significance. I'd like to isolate three characters, 4-6, and bring
only those records where these digits are equal to 123. I tried adding a
column in Microsoft Query, but was unable to make a mid function work.

Is there any hope? I'd prefer to use Excel query tool due to the
limitations of linked tables with Microsoft Access, and ultimately we need
the report in Excel so it is useful to the end user.
  #2   Report Post  
Michael Malinsky
 
Posts: n/a
Default

In MS Query, go to the Criteria menu and select Add criteria. You should
then see an area between the tables and the date where there is a space for
Criteria, Value and or. So if your part number field is named PartNo, try
putting the following criteria in as follows:

Criteria: LEFT(PartNo,3)
Value: 123

This should limit the output to only those part numbers that begin with 123.


"Excel GuRu" wrote in message
...
I'm querying external data from Excel using Microsoft Query. I'm querying

an
oracle database. I'd like to limit the amount of records that come

accross
so the file is easier to manage. We have 9 digit sales part numbers.

Each
digit has significance. I'd like to isolate three characters, 4-6, and

bring
only those records where these digits are equal to 123. I tried adding a
column in Microsoft Query, but was unable to make a mid function work.

Is there any hope? I'd prefer to use Excel query tool due to the
limitations of linked tables with Microsoft Access, and ultimately we need
the report in Excel so it is useful to the end user.



  #3   Report Post  
Excel GuRu
 
Posts: n/a
Default

Mike, thanks for the quick response , but I couldn't get this to work the way
you described.

"Michael Malinsky" wrote:

In MS Query, go to the Criteria menu and select Add criteria. You should
then see an area between the tables and the date where there is a space for
Criteria, Value and or. So if your part number field is named PartNo, try
putting the following criteria in as follows:

Criteria: LEFT(PartNo,3)
Value: 123

This should limit the output to only those part numbers that begin with 123.


"Excel GuRu" wrote in message
...
I'm querying external data from Excel using Microsoft Query. I'm querying

an
oracle database. I'd like to limit the amount of records that come

accross
so the file is easier to manage. We have 9 digit sales part numbers.

Each
digit has significance. I'd like to isolate three characters, 4-6, and

bring
only those records where these digits are equal to 123. I tried adding a
column in Microsoft Query, but was unable to make a mid function work.

Is there any hope? I'd prefer to use Excel query tool due to the
limitations of linked tables with Microsoft Access, and ultimately we need
the report in Excel so it is useful to the end user.




  #4   Report Post  
Jamie Collins
 
Posts: n/a
Default


Excel GuRu wrote:
I'm querying
an
oracle database. I'd like to limit the amount of records that

come
accross
so the file is easier to manage. We have 9 digit sales part

numbers.
Each
digit has significance. I'd like to isolate three characters,

4-6, and
bring
only those records where these digits are equal to 123.


try
putting the following criteria in as follows:

Criteria: LEFT(PartNo,3)
Value: 123


thanks for the quick response , but I couldn't get this to work the

way
you described.


Try Oracle syntax:

SUBSTR(PartNo,4,3)

Jamie.

--

  #5   Report Post  
Excel GuRu
 
Posts: n/a
Default


Jamie,
Where do I type the formula and will I get a separate column that will
isolate the string I'm looking for, or will I merely be able to query on that
string? This is all new to me so I need some more specific instructions.
Thank you

"Jamie Collins" wrote:


Excel GuRu wrote:
I'm querying
an
oracle database. I'd like to limit the amount of records that

come
accross
so the file is easier to manage. We have 9 digit sales part

numbers.
Each
digit has significance. I'd like to isolate three characters,

4-6, and
bring
only those records where these digits are equal to 123.

try
putting the following criteria in as follows:

Criteria: LEFT(PartNo,3)
Value: 123


thanks for the quick response , but I couldn't get this to work the

way
you described.


Try Oracle syntax:

SUBSTR(PartNo,4,3)

Jamie.

--


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
Using Microsoft Query data in a pivot table. slapana Charts and Charting in Excel 0 January 11th 05 05:03 PM
Can I download Microsoft Query? Missing software for my Version. Tracie Excel Discussion (Misc queries) 1 January 9th 05 04:11 PM
Query of External Data Excel GuRu Excel Discussion (Misc queries) 2 January 3rd 05 07:43 PM
saving wkbk minus MS Query links Bill_S Excel Discussion (Misc queries) 1 January 3rd 05 06:00 PM
How to use a Access Query that as a parameter into Excel database query Karen Middleton Excel Discussion (Misc queries) 1 December 13th 04 07:54 PM


All times are GMT +1. The time now is 07:43 PM.

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

About Us

"It's about Microsoft Excel"