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

Sort Records In Date Order When Date Field Is A String

Status
Not open for further replies.

Sange

Technical User
Jun 10, 2002
85
AU
I've developed a report which will allow users to choose whether the records are to be sorted by location or date.

To do this, I created a string parameter called "Sort Order" which prompts users to select "date" or "location". The only problem is that if the date option is selected then the sort doesn't work properly as it's treating the field as a string (which I understand).

Is it possible to keep this parameter as a string but sort it in date order if this option is selected. I would like to keep the two options (date and location)as strings so I can group them.

Any assistance would be most appreciated.
 
You can rearrange the date so that it sorts correctly, e.g.
Code:
ToText({your.date}, "yyyy/MM/dd")

It's best to give your Crystal version, though in this case it doesn't matter.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top