>Hi Terry,
>
>Thanks for your code. Your code and the others gave me the same result.
>
>Here is the function that I am using that is giving different result as everyone else. Please help.
>
>
>PARAMETERS d1,d2
>
>if (type("d1")="D" and type("d2")="D")
> wd=0
> for D=0 to d2-d1
> if between(DOW(d1+D),2,6)
> wd=wd+1
> endif
> endfor
> return wd
>else
> return 0
>endif
>
>
>Thanks,
>Sam
DOW() function w/o second parameter uses whatever day is currently selected in the Week Starts On list box, which appears on the Regional Tab in the Options dialog box or what is set with SET FDOW TO ...
Change between(DOW(d1+D),2,6) to between(DOW(d1+D,1),2,6)
or in Terry's function :
IF DOW(....,2) < 6
.... + 1
ENDIF
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.