Re: Interpolation Query...

From: Michel Walsh (vanderghast_at_VirusAreFunnierThanSpam)
Date: 02/06/04


Date: Fri, 6 Feb 2004 06:42:30 -0500

Hi,

    You are absolutely right, the four auxiliaries provide the max and the
min. You should add the site condition in those queries AND in the top most
query, just like:

...
FROM ( SELECT x, y, u
            FROM xyData
            WHERE x IN( SELECT * FROM Qxmin )
                    AND y IN ( SELECT * FROM Qymin)
                    AND Site=TheSite ) As a,

Each of these virtual tables,

            SELECT x, y, u
            FROM xyData
            WHERE x IN( SELECT * FROM Qxmin )
                    AND y IN ( SELECT * FROM Qymin)
                    AND Site=TheSite

 should return just one record. If not, there is probably a duplicated
(Site, x, y) value, but you can still add a DISTINCT:

            SELECT DISTINCT x, y, u
            FROM xyData
            WHERE x IN( SELECT * FROM Qxmin )
                    AND y IN ( SELECT * FROM Qymin)
                    AND Site=TheSite

Hoping it may help,
Vanderghast, Access MVP

"DIOS" <sindizzy@softhome.net> wrote in message
news:7d00f3c.0402051432.70256bed@posting.google.com...
> Well Im running some tests that are limited to certain sites and I am
> getting multiple records back. If I do not specicfy the site i get
> even more records back. I follow your interpolation math but the SQL
> query is a little bit over my head and im trying to grasp what its
> doing. The 4 auxiliaries are providing the max and mins for my two
> variables and then my main query will do the interpolation correct?
> Why then do i get multiple records back. They look to be repeated as
> well.
>
> AGP
>
> "Michel Walsh" <vanderghast@VirusAreFunnierThanSpam> wrote in message
news:<egwF00B7DHA.3420@TK2MSFTNGP11.phx.gbl>...
> > Hi,
> >
> > I am glad it worked.
> >
> > Indeed, with ... FROM ( SELECT ... ), this is a known bug... you
have to
> > edit the SQL statement in the SQL view only. If you edit it from the
design
> > view, you are ... done. And that applies only for Jet (the design
interface
> > with MS SQL Server does not have that bug).
> >
> >
> > Vanderghast, Access MVP
> >
> > "DIOS" <sindizzy@softhome.net> wrote in message
> > news:7d00f3c.0402051015.4d158d5a@posting.google.com...
> > > The message is "The Microsoft Jet database engine cannot find the
> > > input table or query 'SELECT x, y, u FROM xyData WHERE x IN( SELECT *
> > > FROM Qxmin ) AND y IN ( SELECT * FROM Qymin)'".
> > >
> > > The SQl take out of the designer is as fllows:
> > > SELECT
> >
0.25*((1-[xi])*(1-[eta])*a.u+(1+[xi])*(1-[eta])*b.u+(1+[xi])*(1+[eta])*c.u+(
> > 1-[xi])*(1+[eta])*d.u)
> > > AS uw, 2*([xw]-a.x)/(b.x-a.x)-1 AS xi, 2*([yw]-a.y)/(d.y-a.y)-1 AS eta
> > > FROM (SELECT x, y, u FROM xyData WHERE x IN( SELECT * FROM Qxmin )
> > > AND y IN ( SELECT * FROM Qymin) ) AS a, (SELECT x, y, u FROM xyData
> > > WHERE x IN( SELECT * FROM Qxmax ) AND y IN ( SELECT * FROM Qymin) )
> > > AS b, (SELECT x, y, u FROM xyData WHERE x IN( SELECT * FROM Qxmax )
> > > AND y IN ( SELECT * FROM Qymax) ) AS c, (SELECT x, y, u FROM xyData
> > > WHERE x IN( SELECT * FROM Qxmin ) AND y IN ( SELECT * FROM Qymax) )
> > > AS d;
> > >
> > > I changed all the square brackets to parenthesis and it worked!!! yet
> > > when I reopen the qury in the designer the brackets are back. So
> > > everytime i edit the query i have to make sure the brackets are
> > > replaced with parenthesis. Weird. let me test some more since im going
> > > to be actually calling the queries through code rather than through
> > > the query designer.
> > >
> > > AGP
> > >
> > >



Relevant Pages

  • RE: Query no longer updatable
    ... For those fields I wanted to update I have use SQL in VB ... can't I edit data in my form?". ... Looking at your SQL is see a Left Join that could stop a query from being ... VolServices ON ExpenseDtl.Activity = VolServices.ServiceType ...
    (microsoft.public.access.queries)
  • Re: Interpolation Query...
    ... I follow your interpolation math but the SQL ... variables and then my main query will do the interpolation correct? ... Why then do i get multiple records back. ... >> when I reopen the qury in the designer the brackets are back. ...
    (microsoft.public.access.queries)
  • Re: union query
    ... Is a union query the way to go and is there a wizard that will help me? ... SQL, or the leftmost tool in the query design toolbar ... Edit this to delete the semicolon and add UNION ALL after it; ...
    (microsoft.public.access.queries)
  • Re: Unresponsive Query Wizard
    ... I have an Excel 2003 user who is using a spreadsheet that pulls data from our SQL server. ... When he opens it and refreshes the data it is fine, it pulls the current data, but when he tries to edit the query, the Query Wizard does not appear, he can see it on the task bar, but when he switches focus using task manager everything is greyed out and nothing works. ...
    (microsoft.public.excel)
  • Pls correct SQL. Urgent
    ... Please correct this SQL which is returning multiple records. ... The above query returns: all unique records ... CALL_STATUS VARCHAR2, ...
    (comp.databases.oracle.server)