Kay Posted February 28, 2004 Share Posted February 28, 2004 Why am I working on a Friday night? Alas. This can't be too hard but my brain has petrified - like wood, not fraidy cats! User inputs a booking date in field BookingDate. I would like a calculation to default the InvoiceDate to the last date of the month. So I pull the month out of the BookingDate and of course no "last day of" command. How about find first date of next month, then subtract a day? Good idea, but how to find first date of next month? Any ideas? You would have my forever gratitude! Kay Link to comment Share on other sites More sharing options...
MoonShadow Posted February 28, 2004 Share Posted February 28, 2004 Hi Kay, Date(Month(BookingDate)+1, Day(1)-1, Year(BookingDate)) Go home. Link to comment Share on other sites More sharing options...
Kay Posted February 28, 2004 Author Share Posted February 28, 2004 Mercy! Thanks MoonShadow. And yes, I will ;-) Link to comment Share on other sites More sharing options...
bruceR Posted February 28, 2004 Share Posted February 28, 2004 Actually it's even simpler: Date(Month(BookingDate)+1, 0, Year(BookingDate)) Day 0 of any month is the last day of the prior month. Link to comment Share on other sites More sharing options...
MoonShadow Posted February 28, 2004 Share Posted February 28, 2004 I knew this would work also: Date(Month(BookingDate)+1, Day(1), Year(BookingDate)) -1 But your suggestion is eloquent indeed. Thank you for the valuable lesson. Link to comment Share on other sites More sharing options...
Recommended Posts
This topic is 7334 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now