I'm wondering with a tremendous doubt, I have these 3 columns just need to bring the smallest record if the date is between the between. Example: If you enter date 12/23/2015 to 01/01/2016 it is not to bring record because the smaller record is dated 12/18/2015.
Myqueryfollowsbutitiswrong,becauseitisbringingthesmallestrecordevenifthedateisnot12/18/2015.
selectmin(b.reg)Menor_Reg,b.dt_ate,b.prontfromrecadatebinnerjointbcboproconb.crm=c.codinnerjointbprofisdonc.id_tbprofis=d.idinnerjointbcbosuseone.id=c.id_tbcbosusinnerjoinrepacagdfonf.crm=b.crminnerjointbconvengonb.conv=g.codwhereb.dt_atebetween'23.12.2015'and'01.01.2016'andb.pront=116312groupbyb.pront,dt_ate
I wanted you to bring the smallest record only if the date was for example 12/18/2015.
Thank you in advance, any help is welcome ...