2 Replies Latest reply: Nov 28, 2014 3:46 AM by arwa lassoued RSS

    I have a problem with left join and setting date detween two dates: this is what i write:

      matable:

      LOAD

      CNI,

      [Nom Prénom],

      [Maternité (Évènements)],

      Date,

      Min(if([Maternité (Évènements)]=1,date(Date))) as mindate,

      Max(if([Maternité (Évènements)]=1,date(Date))) as maxdate

      Resident Année2013

      Group by CNI,[Nom Prénom],[Maternité (Évènements)], Date;

      Left Join(matable)

      LOAD

      CNI,

      [Nom Prénom],

      [Maternité (Évènements)],

      Date,

      if(IsNull(mindate),2,if(Date>maxdate and Date<=date(mindate+365),1,0))as valmaternité

      Resident matable;

       

      the result that iwant to have is : if i don't have a min date then give me 2 , if i have a mindate then if date between mindate and mindate+one year then 1 else 0.