Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Finding month and days
Message
From
25/08/2006 17:10:53
 
 
To
25/08/2006 15:05:11
Chandan Chakraborty
Bangiya Gramin Vikash Bank
Raiganj, India
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 6
OS:
Windows '98
Network:
Windows 98
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01147383
Message ID:
01148729
Views:
22
>Thanks ! It has given a idea. But actually when I proceed further I find that my problem is different.
>
>
> I have tried to work with the help provide by you. For calculating months and days the help is ok. But while I was trying to solve the problem relating to banking I
>failed to find the exact result. By using help of you & Vladimir Zografski
> I am getting different results.Let me consider them one by one.
>
> Rich Pupko Vladimir Zograski
> month Days Month Days
>
> d1=(12/01/2005) 11 31 0 364
> d2=(11/01/2006)
>
>
> if d2=(12/1/2006) 11 32 0 365
> if d2=(13/1/2006) 12 2 0 366
>
> but where
> d1=(12/12/2004)
> d2=(12/03/2006) 14 29 3 365
>
>
> But in our banking system we simply count one year for the period from (1201/2005) to (12/01/2006) and (12/01/2006) is the payment date.
> For the given last period the period of deposit is one year 3 months or 15 months.Please help me.
>
>
SET DATE DMY
date1=DATE(2004,12,12)

date2=DATE(2006,3,12)

mdiff = (YEAR(date2)-YEAR(date1))*12+ (MONTH(date2)-MONTH(date1))
dDiff = date2 - GOMONTH(date1,mdiff)
IF dDiff < 0
	mdiff = m.mdiff -1
	dDiff = date2 - GOMONTH(date1,mdiff)
ENDIF
CLEAR

? mdiff,dDiff && + 1
Previous
Reply
Map
View

Click here to load this message in the networking platform