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

Date Grouping Problem

Status
Not open for further replies.

ChiTownDiva

Technical User
Jan 24, 2001
273
US
I have a report that has following formula:

{@Primary Sort} is

if {?Primary Sort} = 'None' then totext({SESSION.START_DT}, "DD/MM/YY") else
if {?Primary Sort} = 'Location' then {@LocationGroup}+totext({CRSE_SESSION.SITE_CD})


The problem is when I run the report from my PC, the dates sort correctly. When I load the report onto CE and run it from the web, the dates sort incorrectly.

For instance on my PC, the dates will look like this

02/02/2004
02/02/2004
02/10/2004
02/17/2004
02/17/2004
02/19/2004
02/19/2004

On the web, when you run the report, the dates look like this:

02/10/2004
02/17/2004
02/17/2004
02/02/2004
02/02/2004
02/19/2004
02/19/2004

It doesn't seem to be sorting in any particular order--it just seems like it has a problem with dates between 2/1/2004 and 2/9/2004.

Does anybody have a clue what the heck is happening?

Thanks in advance for any assistance with this.

ChiTownDiva [ponytails2]
 
It looks fine, it might be the parm value, try:

if {?Primary Sort} = 'Location' then {@LocationGroup}+totext({CRSE_SESSION.SITE_CD})
else
totext({SESSION.START_DT}, "DD/MM/YY")

-k
 
Or:

if {?Primary Sort} = 'Location' then {@LocationGroup}+totext({CRSE_SESSION.SITE_CD})
else
totext({SESSION.START_DT}, "yyyy/MM/dd")

-k
 
Thanks guys...

Even when I change the formula to one either of you suggested, it still screws stuff up on the web piece.

Have any idea why?

I'm opening the document as Word or Adobe.

Thanks again

ChiTownDiva [ponytails2]
 
OK, change it to just:

totext({SESSION.START_DT}, "yyyy/MM/dd")

Omit the choice, does it still look wrong?

What about if you open it from Crystal itself?

-k
 
What is the exact output that shows on your PC and on enterprise? It can't be what you have shown because you have month first for the date only and the formating shows day first or another portion of text. The problem with the sort (and surprised that you don't have the problem both places) is that once you convert the date to text, that is what it is sorted as.. alphabetically.

Lisa
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top