Bikeman17 Posted March 7, 2009 Posted March 7, 2009 This one eludes me I try to get the Next Month Name result through a calc. MonthName ( Get (Current Date) ) Text This one works fine for the current month but how to get the month? Thanks for your help
bcooney Posted March 7, 2009 Posted March 7, 2009 NextMonthName = MonthName (Date ( Month ( aDate )+1 ; Day ( aDate ) ; Year ( aDate ) ))
Bikeman17 Posted March 7, 2009 Author Posted March 7, 2009 The result is 04/07/2009 but I want to get April as a text result.
IdealData Posted March 7, 2009 Posted March 7, 2009 No, it returns "April" MonthName (Date ( Month ( Get ( CurrentDate ) )+1 ; Day ( Get ( CurrentDate ) ) ; Year ( Get ( CurrentDate ) ) ))
LaRetta Posted March 7, 2009 Posted March 7, 2009 This would sure be a limited calculation ... text month name of next month. Are you aware that you can display any date, including any date from the next month (from layout level date format) as month name only? I don't think I've ever had the need to create a month name as text as a calculation. You may need it but are you sure? :wink2:
bcooney Posted March 7, 2009 Posted March 7, 2009 Good point, LaRetta. He's better off leaving out the MonthName part of the calc and just using formatting.
comment Posted March 7, 2009 Posted March 7, 2009 This could be optimized a little, since the Day() and Year() portions of current date are irrelevant: MonthName ( Date ( Month ( Get (CurrentDate) ) + 1 ; 1 ; 1 ) ) --- ADD: Actually, it MUST be made so, because the suggested: MonthName ( Date ( Month ( Get (CurrentDate) ) + 1 ; Day ( Get (CurrentDate) ) ; Year ( Get (CurrentDate) ) ) ) will return an incorrect result in the 31st day of every month except July and December, and also in the last 3 or 4 days of January (depending on the current year being a leap year or not).
bcooney Posted March 8, 2009 Posted March 8, 2009 Isn't that ironic. I just took the example calc out of the FM Help! But, why would you want 1 for the year?
comment Posted March 8, 2009 Posted March 8, 2009 Isn't that ironic. I just took the example calc out of the FM Help! OMG, so you did. How depressing... But, why would you want 1 for the year? Well, I had to pick a number between 1 and 3,999, and it just happened to be closest at hand. And it's cheaper than 3999 when it comes to printing.
LaRetta Posted March 9, 2009 Posted March 9, 2009 And it's cheaper than 3999 when it comes to printing. And typing 1 for the year is more efficient than typing 3999 because it is 3 less key strokes. :laugh2:
zab Posted March 16, 2009 Posted March 16, 2009 Hello I want to show only the last month in a report. How can I do that? Thanks Isabelle
bcooney Posted March 16, 2009 Posted March 16, 2009 Hello Isabelle. I'm not sure that your question relates to this thread. Perhaps a mod will break it into its own thread. Without more detail, I'd say that you need to FIND all records for the month you wish to include in your report. Read up on finding dates.
Recommended Posts
This topic is 5790 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