Re: Another SQL Server Question
- From: josephlee@xxxxxxxxxxx
- Date: Fri, 25 Jan 2008 17:05:26 -0800 (PST)
On Jan 26, 10:06 am, "Rick Brandt" <rickbran...@xxxxxxxxxxx> wrote:
Actually that is completely correct. What can vary is how much of the work
needing to be done by those queries can be passed to the server to perform and
how much has to be processed locally.
The biggest thing is for the WHERE clause to be executed on the server because
that is what limits the rows brought over. Joins and/or other things that might
be just fine with an Access back end might make it impossible for the server to
perform the row filtering. When that happens a lot of unnecessary data is
pulled from the server.
It is rare for a query to not work at all after moving the tables to ODBC links.
It is somewhat common though for a query to not work very efficiently after
doing so.
--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com
Thanks for the reply Rick. So do you see anything in the calculated
field in my query grid (original post) that would cause SQL Server to
give the "ODBC-call failed" error that I am seeing? As mentioned in
the original post, if I remove the reference to the form field
([Forms]![QDelays]![DateSpan] from the calculated field in the query
grid the problem goes away.
References to form fields in the "where" section of the query grid
work fine as they always have. It's just the reference to the form
field in the query's calculated field "SchedDelay" that is causing the
problem.
If I switch my query to SQL view, this what it looks like:
SELECT Count(MinerDelays.MDID) AS CountOfMDID, LU_Delays.DelayType,
LU_Delays.DelayDesc, Sum(MinerDelays.DelayMins) AS SumOfDelayMins,
[SchedDelay]*[Forms]![QDelays]![DateSpan]*60 AS SchedDelay2
FROM (LU_Panel INNER JOIN (LU_Crew INNER JOIN (LU_Shift INNER JOIN
ShiftProdDetails ON LU_Shift.ShiftID = ShiftProdDetails.Shift) ON
LU_Crew.CrewID = ShiftProdDetails.Crew) ON LU_Panel.PanelID =
ShiftProdDetails.Panel) INNER JOIN (LU_DelayType INNER JOIN (LU_Delays
INNER JOIN MinerDelays ON LU_Delays.DelayCode = MinerDelays.DelayCode)
ON LU_DelayType.DelayType = LU_Delays.DelayType) ON
ShiftProdDetails.ProdShiftID = MinerDelays.ProdShiftID
WHERE (((LU_Shift.Shift) Like [Forms]![QDelays]![Shift]) AND
((ShiftProdDetails.TxtDate) Between [Forms]![QDelays]![FromDate] And
[Forms]![QDelays]![ToDate]) AND ((LU_Crew.Crew) Like [Forms]![QDelays]!
[Crew]) AND ((LU_Panel.Panel) Like [Forms]![QDelays]![Panel]))
GROUP BY LU_Delays.DelayType, LU_Delays.DelayDesc,
[SchedDelay]*[Forms]![QDelays]![DateSpan]*60
HAVING (((LU_Delays.DelayType) Like [Forms]![QDelays]![DelayCat]))
ORDER BY Sum(MinerDelays.DelayMins) DESC;
The reference in the SELECT statement to the "Datespan" form field on
the "QDelays" form is the problem.
.
- Follow-Ups:
- Re: Another SQL Server Question
- From: Rick Brandt
- Re: Another SQL Server Question
- References:
- Another SQL Server Question
- From: josephlee
- Re: Another SQL Server Question
- From: Tom van Stiphout
- Re: Another SQL Server Question
- From: josephlee
- Re: Another SQL Server Question
- From: Rick Brandt
- Another SQL Server Question
- Prev by Date: Re: Another SQL Server Question
- Next by Date: Re: Another SQL Server Question
- Previous by thread: Re: Another SQL Server Question
- Next by thread: Re: Another SQL Server Question
- Index(es):
Relevant Pages
|