Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I have a forumla: stringVar mont

Status
Not open for further replies.

Toxodont

IS-IT--Management
Jul 12, 2002
52
0
0
CA
I have a forumla:

stringVar month_name = monthname(month(minimum({?date})));
numberVar year_name = year(minimum({?date}));

How can I print both those variables off in one field so it ends up like this:

'November, 2003' or 'May, 2003' etc etc

By making them seperate fields I have to leave a big gap between the month and year because sometimes you have small months (May, June...), sometimes you have big months (November, December...). This isn't very nice looking for a report... Any help is much appreciated!

penpen.gif

Toxodont
 
My apologies for not including a subject, I completely overlooked it.
 
There are different ways.

Here's one:

monthname(month(minimum({?date}))) +", "+ totext(year(minimum({?date})),0,"")

You can also create a formula containing:

minimum({?date})

Right click it and select format field->Date/Time-Date Customize the Month to either Mar or March, set the day/hours/minutes/seconds to None, the year to 1999, and the seperator to a comma and a space.

-k
 
Thank you very much synapsevampire, I used your second approach and it's working gravy now!
 
If you decide to do this via a formula in the future, then use :

totext(minimum({?Date}),"MMMM, yyyy")

Reebo
Scotland (Sunny with a Smile)
 
Be cautious if you use Reebos formula in a Grouping, or try to use it for sorting, it will produce bad results.

The safe approach is to use the second choice I identified because the value is still a date type and groups and sorts correctly.

-k
 
SV,

I agree that your second approach is by far the best, I am in no way suggesting my post should be used, I was just showing that your first suggestion was a bit pants.[smile]

Reebo
Scotland (Sunny with a Smile)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top