User defined function exports julian date

anissw

Registered User.
Local time
Today, 15:28
Joined
Jun 11, 2012
Messages
55
Hi- I have created user defined function for lastdayofweek, lastdayofmonth, and firstdayofmonth. When I apply this function to an expression in my query, it returns a julian date. How do I apply the format for the calendar date? Maybe I am not calling my function correctly, so any help is appreciated. Here's my functions below as well as my expression..

Function LastDayThisMonth()
LastDayThisMonth = DateSerial(Year(Date), Month(Date) + 1, 0)
End Function

Function FirstDayThisMonth()
FirstDayThisMonth = DateSerial(Year(Date), Month(Date), 1)
End Function

Function LastDayThisWeek()
LastDayThisWeek = Date - Weekday(Date) + 7
End Function


Date Due: IIf([Displayed Terms]="Net 30 Days",LastDayThisWeek()+30,IIf([Displayed Terms]="Net 45 Days",LastDayThisWeek()+45,IIf([Displayed Terms]="Net 7 Days",LastDayThisWeek()+7,IIf([Displayed Terms]="Net 15 Days",LastDayThisWeek()+15,LastDayThisWeek()))))
 
Last edited:
Thank you so much. I'll review and update. :)
 
You're welcome. No sense reinventing the wheel, and Pat has a lot of experience; her posts can be found throughout this site. They are always a source of info.
 

Users who are viewing this thread

Back
Top Bottom