1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

  2. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

Pulling all rows with the date that is directly less than the date of interest

Discussão em 'Outras Linguagens' iniciado por Stack, Janeiro 27, 2021.

  1. Stack

    Stack Membro Participativo

    I currently have a table that has these fields:

    Name​
    Date​
    Flag​
    John​
    5-28-10​
    N​
    John​
    5-28-10​
    N​
    John​
    5-28-10​
    N​
    John​
    5-29-10​
    Y​
    Rick​
    7-14-12​
    N​
    Rick​
    9-02-13​
    N​
    Rick​
    4-21-15​
    Y​
    Rick​
    6-21-17​
    N​

    I want to pull all the rows with the first date smaller than the date with a "Y" in the Flag column. So for John, I want to pull all 3 rows with the date 5-28-10. However for Rick, I only want to pull the row with the date 9-02-13.

    So the desired output would look like:

    Name​
    Date​
    Flag​
    John​
    5-28-10​
    N​
    John​
    5-28-10​
    N​
    John​
    5-28-10​
    N​
    Rick​
    9-02-13​
    N​

    Is there any way I can do this?

    Continue reading...

Compartilhe esta Página