Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

.NET 

[SOLVED]Days360 in vb6[SOLVED]

If the function uses the parameters startdate and enddate, I found following code from vbcity.com

Code
Public Function Days360(StartDate As Date, EndDate As Date, Optional Method As Boolean = False) As Long
  Dim TempMonths As Long
  Dim StartDay As Long
  Dim EndDay As Long
  StartDay = Day(StartDate)
  EndDay = Day(EndDate)
  If Not Method Then
    If StartDay > 30 Then
      StartDate = DateAdd("d", -1, StartDate)
    End If
    If EndDay = 31 And StartDay > 30 Then
      EndDate = DateAdd("d", 1, EndDate)
    Else
      If EndDay = 31 Then
      EndDate = DateAdd("d", -1, EndDate)
      End If
    End If
  Else
    If StartDay > 30 Then
      StartDate = DateAdd("d", -1, StartDate)
    End If
    If EndDay > 30 Then
      EndDate = DateAdd("d", -1, EndDate)
    End If
  End If
  StartDay = Day(StartDate)
  EndDay = Day(EndDate)
  TempMonths = DateDiff("M", StartDate, EndDate)
  Days360 = (TempMonths * 30) + (EndDay - StartDay)
End Function
Hey iSmile,

have you tried to call the function with:
Code
text22.text  = Days360(text20.text, text21.text)


Possibly Related Threads...
Thread / Author Replies Views Last Post
[.NET] by AzokSep 23, 2014 02:30 PM 10 575 Sep 23, 2014 02:30 PM
Last Post: TheBarret
[.NET] by jcbulletJul 16, 2014 10:39 AM 7 413 Jul 16, 2014 10:39 AM
Last Post: __Digital__
[.NET] by pwntokenApr 23, 2014 01:29 PM 14 352 Apr 23, 2014 01:29 PM
Last Post: pwntoken