比较年龄8岁+SQL

时间:2022-01-27 00:36:38

   var date=new Date();                          
        var curYear=date.getYear();
       var curMonth=(date.getMonth()+1);
       var csrq2=document.all.csrq.value;
       var year=csrq2.substring(0,4);
       var month=csrq2.substring(5,7);
       alert(curYear+'-'+curMonth+':'+year+'-'+month);
       if((Number(curYear)-Number(year))>8){
         alert('year bigger than 8');
       }
      
       if((Number(curYear)-Number(year))==8){
         if((Number(curMonth)-Number(month))>0){
             alert('year is eaual but month');
         }
       }

select (0<TRUNC(months_between(sysdate,p.CSRQ)/12) and TRUNC(months_between(sysdate,p.CSRQ)/12)<=16)--0-16     from dual