Crystal Reports How To — Get First Day and Last Day of Month Based On Month Number E.g. 1

Peter Musu`
1 min readAug 5, 2020

--

Crystal Reports How To — Get First Day and Last Day of Month Based On Month Number E.g. 1

Scenario:

Get the first day and last day of month based on Month Integer E.g. 1 for January

1. Create Formula in Crystal called ‘Month’. User will enter or select 1 for January. Use the ‘Value’ and ‘Description’ fields.

2. Create a Formula ‘StartOfMonth’ — Date(year(currentdate), {?Month},1)

3. Create a Formula ‘EndOfMonth’ — dateadd(“m”, 1, {@StartOfMonth})-1

Check the output by adding the formulas to the report.

4. In ‘Selection Formula’, add the following -

({Command.Post Date} >= {@StartOfMonth} and{Command.Post Date} <= {@EndOfMonth})

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

No responses yet

Write a response