query

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • kevcar40

    query

    Hi
    i have a table containing the following fields

    man_date type
    test wheremeas measured value
    1/1/08 12:00:00 M1
    Hardness Top 2.4
    1/1/08 12:00:00 M1
    Width Bot 4.5
    1/1/08 12:00:00 M2
    Hardness Top 3.6
    2/1/08 12:00:00 M2
    Hardness Top 9.2

    What i want to do is create a gird containing the result of a date
    range query

    ie


    m1 M2
    man_date Top Bot
    Top Bot
    1/1/08 12:00:00 2.4 4.5
    3.6
    2/1/08
    12:00:00
    9.2

    the only way i can think of doing this is to write a query for each
    type
    then write a query for each wheremeas
    then join then together

    is there another quicker way

    thanks
    kevin


  • Roger

    #2
    Re: query

    On Jun 24, 4:26 am, kevcar40 <kevca...@btint ernet.comwrote:
    Hi
    i have a table  containing the following fields
    >
    man_date                          type
    test                 wheremeas        measured value
    1/1/08 12:00:00                   M1
    Hardness                  Top                    2.4
    1/1/08 12:00:00                   M1
    Width                     Bot                   4.5
    1/1/08 12:00:00                   M2
    Hardness                  Top                    3.6
    2/1/08 12:00:00                   M2
    Hardness                  Top                    9.2
    >
    What i want to do is create a gird containing the result of a date
    range query
    >
    ie
    >
    m1                                         M2
    man_date                  Top            Bot
    Top            Bot
    1/1/08 12:00:00           2.4            4.5
    3.6
    2/1/08
    12:00:00
    9.2
    >
    the only way i can think of doing this is to write  a query for each
    type
    then write a query for each wheremeas
    then join then together
    >
    is there another quicker way
    >
    thanks
    kevin
    wrap around text is hard to decipher so I abbreviated things, the best
    I could, let us know is something was deciphered incorrectly

    man_date type test wmeas mv
    1/1/08 M1 Hardness Top 2.4
    1/1/08 M1 Width Bot 4.5
    1/1/08 M2 Hardness Top 3.6
    2/1/08 M2 Hardness Top 9.2


    m1 M2 man_date Top Bot
    Top Bot 1/1/08 2.4 4.5
    Top Bot 1/1/08 3.6
    Top Bot 2/1/08 9.2

    now for Jan1, we have 2 top values, 2.4 and 3.6... what's the rule on
    how report them on seperate lines, ie 2.4 / 3.6 vs 3.6 / 2.4

    how does the 'test' field fit into this if at all



    Comment

    • kevcar40

      #3
      Re: query

      On 24 Jun, 11:58, Roger <lesperan...@na tpro.comwrote:
      On Jun 24, 4:26 am, kevcar40 <kevca...@btint ernet.comwrote:
      >
      >
      >
      >
      >
      Hi
      i have a table  containing the following fields
      >
      man_date                          type
      test                 wheremeas        measured value
      1/1/08 12:00:00                   M1
      Hardness                  Top                   2.4
      1/1/08 12:00:00                   M1
      Width                     Bot                    4.5
      1/1/08 12:00:00                   M2
      Hardness                  Top                   3.6
      2/1/08 12:00:00                   M2
      Hardness                  Top                   9.2
      >
      What i want to do is create a gird containing the result of a date
      range query
      >
      ie
      >
      m1                                         M2
      man_date                  Top            Bot
      Top            Bot
      1/1/08 12:00:00           2.4            4.5
      3.6
      2/1/08
      12:00:00
      9.2
      >
      the only way i can think of doing this is to write  a query for each
      type
      then write a query for each wheremeas
      then join then together
      >
      is there another quicker way
      >
      thanks
      kevin
      >
      wrap around text is hard to decipher so I abbreviated things, the best
      I could, let us know is something was deciphered incorrectly
      >
      man_date type test          wmeas     mv
      1/1/08        M1 Hardness      Top     2.4
      1/1/08        M1 Width            Bot     4.5
      1/1/08        M2 Hardness       Top    3.6
      2/1/08        M2 Hardness       Top    9.2
      >
      m1     M2   man_date Top    Bot
      Top    Bot   1/1/08       2.4    4.5
      Top    Bot   1/1/08       3.6
      Top    Bot   2/1/08       9.2
      >
      now for Jan1, we have 2 top values, 2.4 and 3.6... what's the rule on
      how report them on seperate lines, ie 2.4 / 3.6 vs 3.6 / 2.4
      >
      how does the 'test' field fit into this if at all- Hide quoted text -
      >
      - Show quoted text -
      man_date = date
      Type = M1 or M2 etc...........
      Test = Hardness, width etc...........
      wheremeas = top, bottom
      measval = measurement taken

      test field is the type of test undertaken ie hardness or width
      in the date field there is also a time stamp which makes it unique
      so for hardness
      i am looking for
      date M1 m2
      top bot top bot
      1/1/08 2.4 3.6 9.2

      Comment

      • Roger

        #4
        Re: query

        On Jun 24, 5:26 am, kevcar40 <kevca...@btint ernet.comwrote:
        On 24 Jun, 11:58, Roger <lesperan...@na tpro.comwrote:
        >
        >
        >
        >
        >
        On Jun 24, 4:26 am, kevcar40 <kevca...@btint ernet.comwrote:
        >
        Hi
        i have a table  containing the following fields
        >
        man_date                          type
        test                 wheremeas        measured value
        1/1/08 12:00:00                   M1
        Hardness                  Top                    2.4
        1/1/08 12:00:00                   M1
        Width                     Bot                   4.5
        1/1/08 12:00:00                   M2
        Hardness                  Top                    3.6
        2/1/08 12:00:00                   M2
        Hardness                  Top                    9.2
        >
        What i want to do is create a gird containing the result of a date
        range query
        >
        ie
        >
        m1                                         M2
        man_date                  Top            Bot
        Top            Bot
        1/1/08 12:00:00           2.4            4.5
        3.6
        2/1/08
        12:00:00
        9.2
        >
        the only way i can think of doing this is to write  a query for each
        type
        then write a query for each wheremeas
        then join then together
        >
        is there another quicker way
        >
        thanks
        kevin
        >
        wrap around text is hard to decipher so I abbreviated things, the best
        I could, let us know is something was deciphered incorrectly
        >
        man_date type test          wmeas     mv
        1/1/08        M1 Hardness      Top     2.4
        1/1/08        M1 Width            Bot     4.5
        1/1/08        M2 Hardness       Top    3.6
        2/1/08        M2 Hardness       Top    9.2
        >
        m1     M2   man_date Top    Bot
        Top    Bot   1/1/08       2.4    4.5
        Top    Bot   1/1/08       3.6
        Top    Bot   2/1/08       9.2
        >
        now for Jan1, we have 2 top values, 2.4 and 3.6... what's the rule on
        how report them on seperate lines, ie 2.4 / 3.6 vs 3.6 / 2.4
        >
        how does the 'test' field fit into this if at all- Hide quoted text -
        >
        - Show quoted text -
        >
        man_date = date
        Type = M1 or M2 etc...........
        Test = Hardness, width  etc...........
        wheremeas = top, bottom
        measval = measurement taken
        >
        test field is the type of test undertaken ie hardness or width
        in the date field there is also a time stamp which makes it unique
        so for hardness
        i am looking for
        date           M1             m2
                     top   bot      top   bot
        1/1/08   2.4    3.6       9.2- Hide quoted text -
        >
        - Show quoted text -
        for the hardness test, shouldn't it looks like this

        date M1 m2
        top bot top bot
        1/1/08 2.4 3.6
        2/1/08 9.2

        and this for the width test
        date M1 m2
        top bot top bot
        1/1/08 4.5

        Comment

        Working...