Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

Sorting in Queries

Discussion in 'Information Technology' started by Zach, Jul 28, 2006.

  1. Zach

    Zach
    Expand Collapse
    Guest

    I have created a Select Query in which I have the following fields:
    Parameter1, Expression1, Parameter2, Expression2, Parameter3, etc.
    Right now the fields are linked so that if I sort Parameter1 in
    ascending order, the rows of all of the other parameters will still
    correspond to the same row of Parameter1.

    I want to link Parameter1 with Expression1, Parameter2 with
    Expression2, and so on so that I can sort each parameter in ascending
    order at the same time.

    So in other words, I want the rows of Parameter1 and Expression1 to
    correspond but I don't want the rows of Parameter1 and Parameter2 to
    correspond.


    Is this possible? If so, how do I do it?


    Thanks,
    Zach
     
  2. Loading...

    Similar Threads Forum Date
    Importance of Hukamnama - Some Queries Sikh Sikhi Sikhism Jun 14, 2009
    Queries History of Sikhism Oct 26, 2006

  3. NetworkTrade

    NetworkTrade
    Expand Collapse
    Guest

    I don't know what you mean by 'Expression'
    --
    NTC


    "Zach" wrote:

    > I have created a Select Query in which I have the following fields:
    > Parameter1, Expression1, Parameter2, Expression2, Parameter3, etc.
    > Right now the fields are linked so that if I sort Parameter1 in
    > ascending order, the rows of all of the other parameters will still
    > correspond to the same row of Parameter1.
    >
    > I want to link Parameter1 with Expression1, Parameter2 with
    > Expression2, and so on so that I can sort each parameter in ascending
    > order at the same time.
    >
    > So in other words, I want the rows of Parameter1 and Expression1 to
    > correspond but I don't want the rows of Parameter1 and Parameter2 to
    > correspond.
    >
    >
    > Is this possible? If so, how do I do it?
    >
    >
    > Thanks,
    > Zach
    >
    >
     
  4. Lynn Trapp

    Lynn Trapp
    Expand Collapse
    Guest

    Zach,
    Could you post the SQL for your query? It also might be helpful if we had
    some sample data to look at.

    --
    Lynn Trapp
    MS Access MVP
    www.ltcomputerdesigns.com
    Access Security: www.ltcomputerdesigns.com/Security.htm
    Jeff Conrad's Access Junkie List:
    http://home.bendbroadband.com/conradsystems/accessjunkie.html



    "Zach" <zpf100@gmail.com> wrote in message
    news:1148574065.815933.120330@38g2000cwa.googlegroups.com...
    >I have created a Select Query in which I have the following fields:
    > Parameter1, Expression1, Parameter2, Expression2, Parameter3, etc.
    > Right now the fields are linked so that if I sort Parameter1 in
    > ascending order, the rows of all of the other parameters will still
    > correspond to the same row of Parameter1.
    >
    > I want to link Parameter1 with Expression1, Parameter2 with
    > Expression2, and so on so that I can sort each parameter in ascending
    > order at the same time.
    >
    > So in other words, I want the rows of Parameter1 and Expression1 to
    > correspond but I don't want the rows of Parameter1 and Parameter2 to
    > correspond.
    >
    >
    > Is this possible? If so, how do I do it?
    >
    >
    > Thanks,
    > Zach
    >
     
  5. Zach

    Zach
    Expand Collapse
    Guest

    Here's the code from the SQL View of my query:
    SELECT Actual.CTP, Abs((Predicted.CTP-Actual.CTP)/Actual.CTP*100) AS
    [CTP % Error], Actual.Flow,
    Abs((Predicted.Flow-Actual.Flow)/Actual.Flow*100) AS [Flow % Error],
    Actual.Pressure,
    Abs((Predicted.Pressure-Actual.Pressure)/Actual.Pressure*100) AS
    [Pressure % Error], Actual.DHS,
    Abs((Predicted.DHS-Actual.DHS)/Actual.DHS*100) AS [DHS % Error],
    Actual.Keff, Abs((Predicted.Keff-Actual.Keff)/Actual.Keff*100) AS [Keff
    % Error], Actual.MFLCPR,
    Abs((Predicted.MFLCPR-Actual.MFLCPR)/Actual.MFLCPR*100) AS [MFLCPR %
    Error], Actual.MAPRAT,
    Abs((Predicted.MAPRAT-Actual.MAPRAT)/Actual.MAPRAT*100) AS [MAPRAT %
    Error], Actual.FDLRX,
    Abs((Predicted.FDLRX-Actual.FDLRX)/Actual.FDLRX*100) AS [FDLRX %
    Error], Actual.[T-FACT],
    Abs((Predicted.[T-FACT]-Actual.[T-FACT])/Actual.[T-FACT]*100) AS
    [T-FACT % Error], Actual.[P-PCS],
    Abs((Predicted.[P-PCS]-Actual.[P-PCS])/Actual.[P-PCS]*100) AS [P-PCS %
    Error], Actual.Exposure,
    Abs((Predicted.Exposure-Actual.Exposure)/Actual.Exposure*100) AS
    [Exposure % Error]
    FROM Actual INNER JOIN Predicted ON Actual.[Evolution
    ID]=Predicted.[Evolution ID]
    ORDER BY Actual.CTP;


    By Expression1 I just mean an expression that I wrote. The expressions
    that I'm using are all % Error of each parameter.

    So Parameter1 is Actual.CTP and Expression1 is % Error of CTP,
    Parameter2 is Actual.Flow and Expression2 is % Error of Flow, and so
    on...

    I wanted to sort each parameter value in ascending order and still have
    the % Error line up with the corresponding parameter. I hope this makes
    sense...


    Thanks again,
    Zach
     
  6. Joseph Meehan

    Joseph Meehan
    Expand Collapse
    Guest

    Zach wrote:
    > I have created a Select Query in which I have the following fields:
    > Parameter1, Expression1, Parameter2, Expression2, Parameter3, etc.
    > Right now the fields are linked so that if I sort Parameter1 in
    > ascending order, the rows of all of the other parameters will still
    > correspond to the same row of Parameter1.
    >
    > I want to link Parameter1 with Expression1, Parameter2 with
    > Expression2, and so on so that I can sort each parameter in ascending
    > order at the same time.
    >
    > So in other words, I want the rows of Parameter1 and Expression1 to
    > correspond but I don't want the rows of Parameter1 and Parameter2 to
    > correspond.
    >
    >
    > Is this possible? If so, how do I do it?
    >
    >
    > Thanks,
    > Zach


    It is not clear what you are doing, but it appears you want to sort
    first on the Parameter and then on the Expression (put the Parameter field
    to the left of the Expression field. and sort on both fields.


    --
    Joseph Meehan

    Dia duit
     
  7. John Vinson

    John Vinson
    Expand Collapse
    Guest

    On 25 May 2006 09:21:05 -0700, "Zach" <zpf100@gmail.com> wrote:

    >I have created a Select Query in which I have the following fields:
    >Parameter1, Expression1, Parameter2, Expression2, Parameter3, etc.
    >Right now the fields are linked so that if I sort Parameter1 in
    >ascending order, the rows of all of the other parameters will still
    >correspond to the same row of Parameter1.
    >
    >I want to link Parameter1 with Expression1, Parameter2 with
    >Expression2, and so on so that I can sort each parameter in ascending
    >order at the same time.
    >
    >So in other words, I want the rows of Parameter1 and Expression1 to
    >correspond but I don't want the rows of Parameter1 and Parameter2 to
    >correspond.
    >
    >
    >Is this possible? If so, how do I do it?


    What's the structure of your Table? The Query has no independent
    existance: it's just reflecting whatever is in its table or tables.

    If your Table has the fields you describe then the answer is no, you
    cannot; and your table structure is improper - you have a one to many
    relationship embedded in each record. Access sorts records as a whole;
    if you have a record which contains these fields, then you can only
    sort the entire record, and all its pieces will follow.

    I suspect you need another table with three fields: a foreign key to
    your main table, an Expression, and a Parameter. "Records are cheap,
    fields are expensive"!

    John W. Vinson[MVP]
     
  8. Zach

    Zach
    Expand Collapse
    Guest

    That answers my question. Thanks!
     

Share This Page