Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Finding month and days
Message
From
21/08/2006 16:08:37
 
 
To
21/08/2006 15:50:48
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:
01147409
Views:
19
>>>Hello Experts!
>>>
>>>I want to find the number of days and month from from a range of date. Here is my problem:
>>>
>>>I have two date(british date);
>>>
>>>date1="12/12/2005" and date2=21/08/2006
>>>
>>>Thriugh mathematics I know the difference is ;
>>>
>>>8 months and 10 days.
>>>
>>>How I can proceed with VFP to get the result?
>>>
>>>Chandan
>>
>>10 days ? sure ?
>>
>>
>>SET DATE DMY
>>date1=CAST("12/12/2005" as d)
>>*
>>date2=CAST("21/08/2006" as d)
>>
>>mdiff =((YEAR(date2)-YEAR(date1))*12+MONTH(date2)-MONTH(date1)) % 12
>>dDiff = date2 - GOMONTH(date1,mdiff)
>>CLEAR
>>
>>? mdiff,dDiff
>>
>PMFJI, Fabio
> but I think it depends on if you just want the difference between the two days, such as your example, or if you need the number of days for that period for finanical purposes, which causes one day to be added to the difference because you have to include the begin and end days of the period. Hope this makes since.
>
>Beth

sorry but this is a common financial error.
* put money in the "12/12/2005" day
* get money in the "13/12/2005" day
* financial days are 1 for me not 2
otherwise
* put 1M$ money in the "12/12/2005" day ( at 8.01 )
* get 1M$ money in the "12/12/2005" day ( at 8.02 ) with 1 day of interest
* repeat the operation at 8.03,8.05 ....
* to the evening you are richer
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform