Advertisement

05.08.2007 at 10:39AM PDT, ID: 22559714
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.2

Looking for the most efficient code to execute SQL

Asked by c9k9h in Microsoft Access Database

Tags: , ,

I have the code below for a pass-through query that appends to a table.  It runs very slow and I noticed when I was debugging that it appears to run through the pass-through (or some other) query twice.  I'm not sure about that but wanted to see if any experts could help me write this more efficiently.  Bottom line:  I want to pull records back from our Teradata environment into an access database, then append the records to a table.  

Private Sub cmdUpdateRecords_Click()

Dim db As DAO.Database
Dim qd As QueryDef
Dim strSQL As String

Set db = CurrentDb()

On Error Resume Next
DoCmd.DeleteObject acQuery, "qry_GPC_Data"
On Error GoTo 0

For Each qd In db.QueryDefs
    If qd.Type = 80 Or qd.Type = 112 Then            /*Steppin through this line is where it appears two queries are being processed*/
        qd.Properties("odbcTimeout") = 120
    End If
Next qd

strSQL = "select * FROM SO_MIR_D.GPC_Report_Data "
strSQL = strSQL & "WHERE(REPORTINGDATE Between '" & Format(Me!txtBeginDate, "yyyy/mm/dd") & "' and '" & Format(Me!txtEndDate, "yyyy/mm/dd") & "')"
Set qd = db.CreateQueryDef("qry_GPC_Data")
qd.Connect = "ODBC;DSN=TDDEV;MODE=SHARE;DBALIAS=TDDEV;"
qd.SQL = strSQL
qd.ReturnsRecords = True
DoCmd.OpenQuery "qry_Append_GPC_Data"

End Sub

The  "DoCmd.OpenQuery "qry_Append_GPC_Data"" line looks at this SQL:
SELECT * INTO tbl_GPC_Data FROM qry_GPC_Data;

Any help is appreciated.  Thank you.  Karen


Start Free Trial
 
Loading Advertisement...
 
[+][-]05.08.2007 at 12:08PM PDT, ID: 19052293

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.08.2007 at 12:13PM PDT, ID: 19052315

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.08.2007 at 12:26PM PDT, ID: 19052385

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.08.2007 at 12:52PM PDT, ID: 19052553

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Microsoft Access Database
Tags: access, pass, queries
Sign Up Now!
Solution Provided By: jefftwilley
Participating Experts: 4
Solution Grade: A
 
 
[+][-]05.08.2007 at 01:32PM PDT, ID: 19052843

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.08.2007 at 01:54PM PDT, ID: 19052973

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.08.2007 at 02:05PM PDT, ID: 19053039

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.08.2007 at 02:12PM PDT, ID: 19053083

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.08.2007 at 02:16PM PDT, ID: 19053117

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.08.2007 at 02:20PM PDT, ID: 19053142

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.08.2007 at 02:24PM PDT, ID: 19053173

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.08.2007 at 02:48PM PDT, ID: 19053295

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.09.2007 at 05:19AM PDT, ID: 19056277

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32