m.a= day(thisform.text2.Value) m.a1= year(thisform.text2.Value) LOCATE FOR dat=thisform.text2.Value IF !FOUND() ldDate = thisform.text2.value lnMonth = MONTH(ldDate) ldDate = ldDate - DAY(ldDate) + 1 *? ldDate && Make sure we are on the first day of the mont DIMENSION laDOW(7) laDOW(2)='Monday' laDOW(3)='Tuesday' laDOW(4)='Wednesday' laDOW(5)='Thursday' laDOW(6)='Friday' laDOW(7)='Saturday' laDOW(1)='Sunday' *************************** DO WHILE lnMonth = MONTH(ldDate) APPEND BLANK replace dat WITH ldDate Replace WEEKDAY WITH laDoW(DOW(Dat)) IF WEEKDAY='Friday' replace rem WITH 'Friday' endif ldDate = ldDate + 1 ENDDO ELSE =MESSAGEBOX("found)") endif thisform.grid1.refreshthanks,
>thisform.text2.value=01/01/2005 (DD/MM/YYYY date format?) >lnMonth=month(thisform.text2.value) && String: lnMonth=val(substr(thisform.text2.value,4,2)) && 01 >lnYear=year(thisform.text2.value) && string: lnYear=val(substr(thisform.text2.value,7,4)) && 2005 >lnDate=EVALUATE('{^'+STR(lnYear,4)+ '-' + TRANSFORM(lnMonth,'@L 99') + '-01}') >DIMENSION laDOW(7) >laDOW(1)='Monday' >laDOW(2)='Tuesday' >laDOW(3)='Wednesday' >laDOW(4)='Thursday' >laDOW(5)='Friday' >laDOW(6)='Saturday' >laDOW(7)='Sunday' >FOR lnMonthCounter=1 to 12 > FOR lnDayCounter=1 to VAL(DTOC(GOMONTH(lnDate,1)-DAY(lnDate))) && Number of days in the month > APPEND BLANK > Replace yourDate WITH EVALUATE('{^'+STR(lnYear,4)+ '-' + TRANSFORM(lnMonthCounter,'@L 99') + '-' + TRANSFORM(lnDayCounter,'@L 99') + '}') > Replace WEEKDAY WITH laDoW(DOW(yourDate)) > ENDFOR >ENDFOR>
>>>>IF MONTH(thisform.text2.Value)=01 >>>> FOR n=1 TO 31 >>>> APPEND BLANK >>>> endfor >>>>endif >>>>>>>>>Hi Mohammed,