LOCATE FOR month(dat)=(thisform.text2.Value) .AND. table1.mac1=ALLTRIM(thisform.text18.value ) AND TYP=THISFORM.TEXT24.VALUE IF FOUND() cFilter = "MONTH(dat) == " + ALLTRIM(STR(MONTH(thisform.Text2.Value)))+ " AND "+; "Mac1 == '" + ALLTRIM(thisform.Text18.Value) + "' AND "+; "Typ == " + ALLTRIM(STR(thisform.Text24.Value)) set filter to &cFilter thisform.grid1.Visible=.t. thisform.text10.visible=.t. thisform.text11.visible=.t. thisform.text13.visible=.t. thisform.text14.visible=.t. thisform.text15.visible=.t. thisform.text16.visible=.t. thisform.label13.visible=.t. thisform.grid1.Refresh *********************************************&&code for calculate local lnSec10,lnSec11,lnSec13,lnSec14,lnSec15,lnSec16 SUM CTOT(plan) - CTOT("0000:00:00") to lnSec * ? PADL(INT(lnSec/3600), 2, "0") + ":" + ; PADL(INT((lnSec%3600)/60),2, "0") + ":" + ; PADL(lnSec % 60,2, "0") SUM VAL(LEFT(plan,2))*3600 + ; VAL(SUBSTR(plan,4,2))*60 + ; VAL(RIGHT(plan,4)) TO lnSec lnSec10=lnSec THISFORM.TEXT10.VALUE= PADL(INT(lnSec/3600), 4, "0") + ":" + ; PADL(INT((lnSec%3600)/60),2, "0") * lnCost=thisform.text3.value *THISFORM.TEXT10.VALUE = ROUND(lnSec/3600*lnCost,2) SUM CTOT(true) - CTOT("00:00:00") to lnSec * ? PADL(INT(lnSec/3600), 2, "0") + ":" + ; PADL(INT((lnSec%3600)/60),2, "0") + ":" + ; PADL(lnSec % 60,2, "0") SUM VAL(LEFT(true,2))*3600 + ; VAL(SUBSTR(true,4,2))*60 + ; VAL(RIGHT(true,2)) TO lnSec lnSec11=lnSec THISFORM.TEXT11.VALUE= PADL(INT(lnSec/3600),4, "0") + ":" + ; PADL(INT((lnSec%3600)/60),2, "0") thisform.text19.value=(lnSec11/lnSec10)*(100) &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& SUM CTOT(HOT) - CTOT("0000:00:00") to lnSec * ? PADL(INT(lnSec/3600), 2, "0") + ":" + ; PADL(INT((lnSec%3600)/60),4, "0") + ":" + ; PADL(lnSec % 60,4, "0") SUM VAL(LEFT(HOT,4))*3600 + ; VAL(SUBSTR(HOT,4,2))*60 + ; VAL(RIGHT(HOT,4)) TO lnSec lnSec13=lnSec THISFORM.TEXT13.VALUE= PADL(INT(lnSec/3600), 4, "0") + ":" + ; PADL(INT((lnSec%3600)/60),4, "0") THISFORM.TEXT13.VALUE= PADL(INT(lnSec/3600), 4, "0") + ":" + ; PADL(INT((lnSec%3600)/60),2, "0") thisform.text20.value=(lnSec13/lnSec10)*(100) &&&&&&&&&&&&&&&&&&& SUM CTOT(BALANC) - CTOT("00:00:00") to lnSec * ? PADL(INT(lnSec/3600), 2, "0") + ":" + ; PADL(INT((lnSec%3600)/60),2, "0") + ":" + ; PADL(lnSec % 60,2, "0") SUM VAL(LEFT(BALANC,2))*3600 + ; VAL(SUBSTR(BALANC,4,2))*60 + ; VAL(RIGHT(BALANC,2)) TO lnSec lnSec14=lnSec THISFORM.TEXT14.VALUE= PADL(INT(lnSec/3600), 4, "0") + ":" + ; PADL(INT((lnSec%3600)/60),2, "0") THISFORM.TEXT14.VALUE= PADL(INT(lnSec/3600), 4, "0") + ":" + ; PADL(INT((lnSec%3600)/60),2, "0") thisform.text21.value=(lnSec14/lnSec10)*(100) ********************* SUM CTOT(mint) - CTOT("00:00:00") to lnSec * ? PADL(INT(lnSec/3600), 2, "0") + ":" + ; PADL(INT((lnSec%3600)/60),2, "0") + ":" + ; PADL(lnSec % 60,2, "0") SUM VAL(LEFT(mint,2))*3600 + ; VAL(SUBSTR(mint,4,2))*60 + ; VAL(RIGHT(mint,2)) TO lnSec lnSec15=lnSec THISFORM.TEXT15.VALUE= PADL(INT(lnSec/3600), 4, "0") + ":" + ; PADL(INT((lnSec%3600)/60),2, "0") THISFORM.TEXT15.VALUE= PADL(INT(lnSec/3600), 4, "0") + ":" + ; PADL(INT((lnSec%3600)/60),2, "0") thisform.text22.value=(lnSec15/lnSec10)*(100) ***************************************************** SUM CTOT(other) - CTOT("00:00:00") to lnSec * ? PADL(INT(lnSec/3600), 2, "0") + ":" + ; PADL(INT((lnSec%3600)/60),2, "0") + ":" + ; PADL(lnSec % 60,2, "0") SUM VAL(LEFT(other,2))*3600 + ; VAL(SUBSTR(other,4,2))*60 + ; VAL(RIGHT(other,2)) TO lnSec lnSec16=lnSec THISFORM.TEXT16.VALUE= PADL(INT(lnSec/3600), 4, "0") + ":" + ; PADL(INT((lnSec%3600)/60),2, "0") THISFORM.TEXT16.VALUE= PADL(INT(lnSec/3600), 4, "0") + ":" + ; PADL(INT((lnSec%3600)/60),2, "0") thisform.text23.value=(lnSec16/lnSec10)*(100) ********************************************* end of calculate RETURN else =messagebox(" not found ") thisform.grid1.visible=.f. thisform.text17.value=CTOD(" / / /") thisform.text4.value="00:00:" thisform.text5.value="00:00:" thisform.text6.value="00:00:" thisform.text7.value="00:00:" thisform.text8.value="00:00:" thisform.text9.value="00:00:" thisform.text12.value=SPACE(10) thisform.text10.visible=.f. thisform.text11.visible=.f. thisform.text13.visible=.f. thisform.text14.visible=.f. thisform.text15.visible=.f. thisform.text16.visible=.f. ENDIF <pre> thanks >>hi, >>i'm sorry, but nothing at mygrid, i try browse after the code ,i see the >> mytable bottom, >> can i use it as locate and if found i put the same code again. >> >>thanks >>><pre> >>>cFilter = "MONTH(dat) == " + ALLTRIM(STR(MONTH(thisform.Text2.Value)))+ " AND "+; >>> "Mac1 == '" + ALLTRIM(thisform.Text18.Value) + "' AND "+; >>> "Typ == " + ALLTRIM(STR(thisform.Text24.Value)) >>> >>>set filter to &cFilter >>>>