I have this function
Public Function GetIntervalWeeks(mycriteria As Integer) As Long
Dim a As Date
Dim b As Date
a = Format(GetLastRequestDate(mycriteria), "mm/dd/yyyy")
b = Format(GetLastDeliveryDate(mycriteria), "mm/dd/yyyy")
GetIntervalWeeks = DateDiff("d", b, a)
GetIntervalWeeks = GetIntervalWeeks / 7
End Function
like if I have the value of 5 for the difference of A and B and I will performing division of 5/7 then my function results to 1 instead of 0.7142857142857143.
How will I make it to decimal format and not rounded off.
EDITED: OK I changed the function data type to double or currency and it changed the result to decimal. But is there any other solution?
Public Function GetIntervalWeeks(mycriteria As Integer) As Long
Dim a As Date
Dim b As Date
a = Format(GetLastRequestDate(mycriteria), "mm/dd/yyyy")
b = Format(GetLastDeliveryDate(mycriteria), "mm/dd/yyyy")
GetIntervalWeeks = DateDiff("d", b, a)
GetIntervalWeeks = GetIntervalWeeks / 7
End Function
like if I have the value of 5 for the difference of A and B and I will performing division of 5/7 then my function results to 1 instead of 0.7142857142857143.
How will I make it to decimal format and not rounded off.
EDITED: OK I changed the function data type to double or currency and it changed the result to decimal. But is there any other solution?