Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Calculation between 2 dates
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01526250
Message ID:
01526276
Views:
75
This message has been marked as a message which has helped to the initial question of the thread.
>Hi all,
>
>i have calculation on 2 europeans dates.
>
>i have {^2010-07-31} and i want {^2010-07-01}
>i have {^2010-08-31} and i want {^2010-08-01}
>i have {^2010-09-30} and i want {^2010-09-01}
>
>
>This result is bad
>
> m.oObjet.d_debut = GOMONTH(  m.datefin , -1 ) + 1
>
>
>somebody knows ?
>
>Thank in advance for help
>
>
>bernhart
* 1. Begin of Month

ldDate =  DATE(2010,07,31) 
? BoM(ldDate)

FUNCTION BoM(tdFecha)
  RETURN DATE(YEAR(tdFecha),MONTH(tdFecha),1)
ENDFUNC 

* 2. End Of Month

ldDate =  DATE(2010,07,1) 
? EoM(DATE())

FUNCTION EoM(tdFecha)
  LOCAL ld 
  ld = GOMONTH(tdFecha,1)
  RETURN ld - DAY(ld)
ENDFUNC 
Luis María Guayán
Tucumán, Argentina
________________________________
SysOp de www.PortalFox.com
Nada corre como un zorro
________________________________
Previous
Reply
Map
View

Click here to load this message in the networking platform