visual-foxprofoxpro

Insert data from one .dbf table to another .dbf table in foxpro 6


I have two foxpro tables, one is aa2.dbf and another is tradeinfo.dbf. I need to insert some data from tradeinfo.dbf table to aa2.dbf table within a daterange. Date field is bookdate, I write the following code in visual foxpro 6.

use aa2.dbf
zap
appen from tradeinfo for between (bookdate,ctod(thisform.txtfrom.value),ctod(thisform.txtto.value))

thisform.txtfrom.value and thisform.txtto.value contains from and to date.

It shows me an error

'Function argument value ,type or count is invalid in foxpro 6'.

How can I solve that?or, How can I perform the tasks. Thanks in advance.


Solution

  • ^^^^^

    && assign mdatefrom and mdateto as ControlSource of textfrom and textto ..

    && you can work with text fields and convert with CTOD() after

    ^^^^

    mdatefrom=date()-30 && date 30 days ago, change as needed

    mdateto=date() && today's date

    use aa2

    zap

    append from tradeinfo for bookdate>=mdatefrom .and. bookdate<=mdateto

    go top

    brow

    ======

    Take care,

    Sime