I have the following function in a module. Now how do I run it in a query?
Function GetDays360(TimesheetDate as Date, ReleaseDate as Date)
GetDays360 = ((Year(ReleaseDate)-Year(TimesheetDate))-1)*360+((12-Month(TimesheetDate))*30)+(30-Day(TimesheetDate))+((Month(ReleaseDate)-1*30)+(Day(ReleaseDate))
End Function
I saved this as Mod_GetDays360
I added it to a query like this:
Months to Release: GetDays360 ([TimesheetDate,[ReleaseDate])
The query is just calculating the time between i.e., ReleaseDate 10/31/2022 TimesheetDate 9/6/2019 Result 43086
what I expect to get is the number of months which is 38
Not sure where I am going wrong. I am new to functions and modules and vba