Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
360 day year
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00452311
Message ID:
00452647
Views:
25
I've done 360 accounting (30/360,ACT/360,etc). You gota count the months, then multiply by 30 (assuming 30/360) and then add the change (days).
Here is on method you could use:
ldStart={^2000-6-30}
ldEnd={^2000-12-31}
lncountmths=0
lsStart=left(dtos(ldStart),6) && YYYYMM
lsEnd=left(dtos(ldEnd),6)
lsPointer=lsStart
do while lsPointer<lsEnd
if val(right(lsPointer,2))>11
   lsPointer=str(val(left(lsPointer,4))+1,4)+"01"
else
   lsPointer=left(lsPointer,4)+right(str(val(right(lsPointer,2))+101),2)
endif
lncountmths=lncountmths+1
enddo
messagebox(str(lncountmths))
Or - you could OLE w/Excel and use the Excel function.



>I am working on replacing an Excel spreadsheet to VFP in order to use the data for multiple reporting options. The data needs to be in a dbf format. Currently one of the calculations in the Excel spreadsheet uses the Excel function DAYS360. This returns the number of days between two dates based on a 360 day year (not 365 or 366 in leap years). I have been told this is a common accounting method. I have not found an equivalent VFP function to do this.
>
>Has anyone else seen this, is there a function in VFP that would return the same result, or has anyone else written a function to match this?
>
>Thanks,
Imagination is more important than knowledge
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform