You are on page 1of 1

public function totalday(intdate as date) as string

dim strday as string


dim strmonth as string
dim stryear as string
dim strtext as string

dim strprtday as string


dim strprtmonth as string
dim strprtyear as string
dim s as string

strtext = intdate

stryear = year(strtext)
strmonth = month(strtext)
strday = day(strtext)

strprtyear = year(date) - [stryear]


strprtmonth = month(date) - [strmonth]
strprtday = day(date) - [strday]

' // if day is in negative then reverse calculation done \\


if day(date) < strday then
strprtday = strday - day(date)
end if

s = strprtyear & " year, "


s = s & strprtmonth & " month, "
s = s & strprtday & " day"

totalday = s
end function

You might also like