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

Round Date to Month?

Status
Not open for further replies.

Bronte1226

Technical User
Oct 18, 2002
123
US
I am having an issue with my report pulling a wrong date. The exact same field is being used as a group and then again in the detail. In the detail section it is pulling correctly. For some reason in the group section it is not. The values being pulled are not even the correct values.

I was wondering if there was a way to round these dates in the group section to the nearest "month" instead of displaying the entire date. Is this possible? (I can do this in Excel [=MONTH(DATE(,MONTH(A1)+(DAY(A1)>=15),1)) ], so I was assuming there was a way to do this in Crystal too)

Thanks!
 
Sure, you can use a formula like this:

date(year(date), month(date),1)

But why do you think the date is incorrect? If you want to group on month, then go into the group expert and make sure it is set to "print on change of month".

The groupname will show the beginning of the selected period--even if you don't have data on that particular date, as long as there are some records within the period.

-LB
 
Well, I need to do something since the dates don't match.

For instance: The Bill Date for two consecutive months is 11/3/09 and 12/3/09 respectively. In the details area, this prints out right.

However in the group header that is using this field, the exact same field is printing 11/1/09 and 11/29/09. These dates are not even in the field of table it is pulling this field from.

I cannot figure out what is happening here, but if I just use the months from those fields, I will end up with November twice and no December bill, which is incorrect. Am I doing something wrong here to cause this?
 
If you place a field in a group header section, it will show the value that occurs in the first record in the group. Have you suppressed some records? What are you grouping on?

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top