Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to get Monday's date from given date?
Message
 
To
16/04/2002 14:50:51
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00645626
Message ID:
00645641
Views:
8
>Hi All,
>
>I’m working on a payroll overtime program and struggling with the following. End user is suppose to give a date range and overtime is calculated accordingly. Our work week starts on Monday.
>
>My question is ,
> If user gives the starting date (MyDate) any thing other than MONDAY, how to find Monday’s date from MyDate ???
>
>Please Help !!!
>
>TIA
>
>- Jeana -
FUNCTION PreviousMonday

  LPARAMETER tdDate
  
  LOCAL ldresult
  IF DOW(tddate, 1) = 1
    ldresult = tdDate - 6
  ELSE
    ldresult = tdDate - (DOW(tdDate, 1) - 2)
  ENDIF
  RETURN ldresult
ENDFUNC
George

Ubi caritas et amor, deus ibi est
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform