on 11-05-2015 10:47 PM
I'm fairly new to Crystal Reports for Enterprise and searched this question but didn't see anyone answering it. When I build a Crystal Report and want to filter by Current Month each time how do I write the code in the Formula Record Filter? I have a current set of data with labor utilization. I'd like to only see this month's numbers per employee each time I run it without using a static filter or prompt.
Thanks in advance for your help.
Hi Robert,
If your date field is an actual date type, you can use the MonthToDate function like:
MonthToDate ({table.DateField});
Avoid a formula like:
Month ({table.DateField}) = Month (CurrentDate);
If you have records from previous years, you'll need to filter out the year as well.
Good luck,
Brian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
So I've gotten a little further. Apparently since the Month Values are coming through as Abbreviations the code for the filter needs that to work. So I have to use "NOV" instead of 11 for the month.
Is there a built in function to easily convert the abbreviation to number or do I just need to hard code all of these abbreviations?
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.