Amount range

Hi,

I have a table where the salary range and deduction are stored. As an example the salary ranging from 1,000 to 1,500 has a deduction of 100. This is the part where i should be getting the amount for deduction unfortunately i don't get any record though the record exists in the table:

SELECT nfrom, nto, ndeduction from tbldeduct WHERE ;
tbldeduct.nfrom >= thisform.txtngross.value .and.;

tbldeduct.nto <= thisform.txtngross.value


ORDER BY tbldeduct.nfrom INTO CURSOR tmpdeduct

Am i missing something here or these codes are totally wrong

By the way this is the table

Table field:

nfrom nto ndeduct

1,000 1,500 100

thank u, i appreciate all the responses.




Answer this question

Amount range

  • Syed Junaid

    SELECT nfrom, nto, ndeduction from tbldeduct WHERE ;
    thisform.txtngross.value ;
    between nfrom and nto ;
    ORDER BY nfrom INTO CURSOR tmpdeduct

    This type of "between" is compatible with nonVFP backends.


  • rblaco

    SELECT nfrom, nto, ndeduction  from tbldeduct WHERE ;< xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

       tbldeduct.nfrom <= thisform.txtngross.value .AND. ;

       tbldeduct.nto >= thisform.txtngross.value ;

     ORDER BY tbldeduct.nfrom INTO CURSOR tmpdeduct

     

    or

     

    SELECT nfrom, nto, ndeduction FROM tbldeduct WHERE ;

       BETWEEN(thisform.txtngross.value, nfrom, nto) ;

    ORDER BY nfrom INTO CURSOR tmpdeduct



  • Amount range