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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating formula based on part of date being passed in

Status
Not open for further replies.
Mar 20, 2009
102
US
I have the below results set:

State Qtrly Date EmpCnt
AL 2008-05-12 00:00:00.000 1
AL 2008-06-12 00:00:00.000 1
AL 2008-04-12 00:00:00.000 1

What I want the end result to look like in Crystal is:

State Month1 Month2 Month3
AL 1 1 1

I am trying to create a formula as such:

IF Datepart("m", {Command.1stmonth}) in [1,4,7,10] then {Command.employeecount1}
--creating this 3 different times based on if it is the
first, second, or third month of the quarter

The issue is my numbers aren't displaying correctly? Only month2 shows 1, the others show 0? How can I achieve this.

Thanks!

 
Is there a grouping associated with the desired return? Are you putting the three formulas you created in the details section?

_____________________________________
Crystal Reports XI Developer Version
Intersystems Cache 5.X ODBC connection

 
After adding these formulas to the detail section, you need to summarize them at the group section (sum) and suppress the detail section.

-LB
 
It is grouped by abbrev and I currently have the formulas at the group header section.

I will move it to the detail section and follow the instructions of lbass and see what that gets me.
 
Thanks! That worked; my mistake was I had the formulas in the group header.

Thanks again for all your help!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top