Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Finding the payperiod that included 12th of month
Message
From
17/07/2006 19:48:15
 
 
To
17/07/2006 18:05:59
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01137078
Message ID:
01137106
Views:
16
>Hi. I am doing a payroll report. I was told to include the monthly pay period that includes the 12th of the month. We have a 14 day pay cycle.
>
>Q: how can I extract pay periods that just include the 12th? Note that I have a start date and end date for each period (as well as a check date) on each record.
>
>Thanks, Randy

This is not anything like an elegant solution, but I think it will work
FUNCTION has12th
LPARAMETERS StartDate,EndDate
LOCAL llReturn
llReturn = .F.

FOR I = 0 to (EndDate - StartDate)
  IF DAY(StartDate + i) = 12
    llReturn  = .T.
  ENDIF
ENDFOR

RETURN llReturn
Previous
Reply
Map
View

Click here to load this message in the networking platform