>I have little problems.
>
>With code i find
>
>=Test39( {^2004/09/29} ) give 03/10/2004 For 02/10/2004
>=Test39( {^2004/09/20} ) give 26/09/2004 For 25/09/2004
>
>
>A idea ?
>
>bernhart
>
>
>
>*=FirstDay( {^2004/09/22} )
>
>
>FUNCTION Test39( )
> LPARAMETERS dDate
>
> LOCAL ret_val
> ret_val = dDate + (7-DOW(dDate,2)) && tdDate - Dow(tdDate,2) + 1
>
> WAIT WINDOW ret_val
>
>ENDFUNC
>
>
>
>>
>>FUNCTION LastDay(dDate)
>>
>> LOCAL ret_val
>> ret_val = dDate + (7-DOW(dDate,2))
>>
>>RETURN CDOW(ret_val) + " " + DTOC(ret_val)
>>
Function GetFirstDay(tdDate) && Monday first
return tdDate - Dow(tdDate,2) + 1
Function GetLastDay(tdDate) && Monday first,Sunday last
return tdDate - Dow(tdDate,2) + 7
Cetin