[mso] Re: Access Select Query

  • From: "Glenda Wells" <gwells@xxxxxxxxxxx>
  • To: <mso@xxxxxxxxxxxxx>
  • Date: Mon, 28 Mar 2005 11:35:01 -0500

Oops. I meant pretty much decided AGAINST PT queries....=20

-----Original Message-----
From: Glenda Wells=20
Sent: Monday, March 28, 2005 11:32 AM
To: mso@xxxxxxxxxxxxx
Subject: [mso] Re: Access Select Query

I've pretty much decided on PT queries. The propensity for the group I'm
working with to ask for changes at the absolute very last minute is
pretty high. I feel at this point I'm probably better off breaking my
queries into manageable bits via make-tables instead, although, I'm
flexible in this if saved queries are faster.  I was thinking queries
based on the made tables if the tables were indexed would be the fastet
thing but I could be wrong.

The data I'm drawing against is Oracle ODBC.  I need to compare several
years worth of data.  I was thinking to import the tables involved from
the data source and create my own mini-warehouse to extract the data for
past years so all I need from live data is for current year. It's this
current year that I'd like to create the tables on the fly and index
them so additional queries with varius forumlas would run faster.=3D20

The ultimate end result would be a macro to extract current year data
(on the fly) & past year data (from the mini-warehouse) and populate
several fields of an Excel Worksheet whereupon there are formulas to get
percentages, comparison values, totals and so forth.  This action would
be via macro (or VBA if I can)run from a button on a form that the
end-user would click, enter his/her password and in a SHORT amount of
time, be able to print the Excel worksheet.  The use of th is worksheet
is to help determine the path for fundraising so immediate data is
required.

Does that make sense?  Answer the question?



-----Original Message-----
From: Jim Pettit [mailto:jimpettit@xxxxxxxxx]=3D20
Sent: Friday, March 25, 2005 04:03 PM
To: mso@xxxxxxxxxxxxx
Subject: [mso] Re: Access Select Query

Glenda--

Sorry it took me so long to get back with you. Now, do you mean you'd
like to see how to create a query, one which uses the ANSI SQL IN and/or
LIKE operators, in VBA? Please let me know, and I'll be happy to do so.

If PT queries won't work -- and they certainly don't always -- you
certainly can make your Access queries on the fly. (And they can be
saved for later use, or destroyed as soon as you're through ith them.)
Remember, though, that Access will optimize a saved query, where as ad
hoc queries need to be built and optimized at run time, so there is
definitely a performance hit.=3D20

Something to remember, too, if you're using Access to pull from SQL
Server or Oracle, is that you can create a PT query to call a stored
procedure that is on the database server, and pass query parameters to
that stored procedure from within Access. If course, while we are
talking about Access here, the art and science of writing and using
stored procedures is definitely out of the realm of this newsgroup; I
doubt Linda (or anyone
else) would be thrilled with us chatting about them here. ;-)

--Jim

-----Original Message-----
From: mso-bounce@xxxxxxxxxxxxx [mailto:mso-bounce@xxxxxxxxxxxxx] On
Behalf Of Glenda Wells
Sent: Thursday, March 24, 2005 8:51 AM
To: mso@xxxxxxxxxxxxx
Subject: [mso] Re: Access Select Query

It does help jim. Thanks.  I've determined that using pass-thru for my
purposes isn't going to work.  So I'm building select and make table
queries. Should I build them on the fly instead of storing them?  Do you
have a sample you'd be willing to share? I'm doing something I've never
done before and need this particular db/process to work quicly.

Right now I'm going to build 5 append queries, one each for the 4 values
I need and one to clear out the table in preparation for using it again.
I've developed processes this way before and it seems to run faster than
trying to get the 4 values in one query.  In this example, it takes 11
minutes to extract my data if I use the and & or rows of criteria.
Doing the append thing for each value shortens that time to about 90
seconds.  However, it would not be practical where there were dozens of
values to extract.

/g

-----Original Message-----
From: Jim Pettit [mailto:jimpettit@xxxxxxxxx]=3D3D20
Sent: Thursday, March 24, 2005 11:40 AM
To: mso@xxxxxxxxxxxxx
Subject: [mso] Re: Access Select Query

Glenda--

As far as I know, Access makes no real distinction between the two
(although I may be wrong). I believe that when the Jet database engine
parses the query, it internally converts the two formats into the same
thing internally; that is, the DB engine makes a list of each of the
values, then compares each item in that list against the table or index.
FWIW, I usually use the IN("value1", "value2") construct, as I tend to
build a lot of queries on the fly from VBA code, and that allows me to,
for example, build shorter query strings, strings that are more readable
when debugging, and strings that can be imported/exported to/from Excel
via the CSV format.
Also, when using the IN, a subquery or series of nexted subqueries can
be placed within the parentheses. For instance:

SELECT vegetables FROM tblProduce WHERE type IN(SELECT type FROM
tblTypes WHERE type =3D3D3D 'cruciferous')

Hope this helps...

--Jim

*************************************************************
You are receiving this mail because you subscribed to mso@xxxxxxxxxxxxx
or MicrosoftOffice@xxxxxxxxxxxxxxxx

To send mail to the group, simply address it to mso@xxxxxxxxxxxxx

To Unsubscribe from this group, send an email to
mso-request@xxxxxxxxxxxxx with the word "unsubscribe" (without the
quotes) in the subject line.

Or, visit the group's homepage and use the dropdown menu.  This will
also allow you to change your email settings to digest or vacation (no
mail).
//www.freelists.org/webpage/mso

To be able to use the files section for sharing files with the group,
send a request to mso-moderators@xxxxxxxxxxxxx and you will be sent an
invitation with instructions.  Once you are a member of the files group,
you can go here to upload/download files:
http://www.smartgroups.com/vault/msofiles
*************************************************************

*************************************************************
You are receiving this mail because you subscribed to mso@xxxxxxxxxxxxx
or MicrosoftOffice@xxxxxxxxxxxxxxxx

To send mail to the group, simply address it to mso@xxxxxxxxxxxxx

To Unsubscribe from this group, send an email to
mso-request@xxxxxxxxxxxxx with the word "unsubscribe" (without the
quotes) in the subject line.

Or, visit the group's homepage and use the dropdown menu.  This will
also allow you to change your email settings to digest or vacation (no
mail).
//www.freelists.org/webpage/mso

To be able to use the files section for sharing files with the group,
send a request to mso-moderators@xxxxxxxxxxxxx and you will be sent an
invitation with instructions.  Once you are a member of the files group,
you can go here to upload/download files:
http://www.smartgroups.com/vault/msofiles
*************************************************************

*************************************************************
You are receiving this mail because you subscribed to mso@xxxxxxxxxxxxx
or MicrosoftOffice@xxxxxxxxxxxxxxxx

To send mail to the group, simply address it to mso@xxxxxxxxxxxxx

To Unsubscribe from this group, send an email to
mso-request@xxxxxxxxxxxxx with the word "unsubscribe" (without the
quotes) in the subject line.

Or, visit the group's homepage and use the dropdown menu.  This will
also allow you to change your email settings to digest or vacation (no
mail).
//www.freelists.org/webpage/mso

To be able to use the files section for sharing files with the group,
send a request to mso-moderators@xxxxxxxxxxxxx and you will be sent an
invitation with instructions.  Once you are a member of the files group,
you can go here to upload/download files:
http://www.smartgroups.com/vault/msofiles
*************************************************************

*************************************************************
You are receiving this mail because you subscribed to mso@xxxxxxxxxxxxx or 
MicrosoftOffice@xxxxxxxxxxxxxxxx

To send mail to the group, simply address it to mso@xxxxxxxxxxxxx

To Unsubscribe from this group, send an email to 
mso-request@xxxxxxxxxxxxx with the word "unsubscribe" (without the quotes) in 
the subject line.

Or, visit the group's homepage and use the dropdown menu.  This will also allow 
you to change your email settings to digest or vacation (no mail).
//www.freelists.org/webpage/mso

To be able to use the files section for sharing files with the group, send a 
request to mso-moderators@xxxxxxxxxxxxx and you will be sent an invitation with 
instructions.  Once you are a member of the files group, you can go here to 
upload/download files:
http://www.smartgroups.com/vault/msofiles
*************************************************************

Other related posts: