cancel
Showing results for 
Search instead for 
Did you mean: 

Bug with sorting on a formula

patrick_simons2
Participant
0 Kudos
58

We're using CR2008 and 2011.

Let's take the following sample to create a MS SQL Server table and fill some values:


USE msdb

IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[dbo].[CRSortTest]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)

DROP TABLE dbo.CRSortTest

CREATE TABLE dbo.CRSortTest

(

SortTest_Cod varchar(10) NOT NULL

)  ON [PRIMARY]

INSERT INTO dbo.CRSortTest

VALUES('A-A')

INSERT INTO dbo.CRSortTest

VALUES('A-B')

INSERT INTO dbo.CRSortTest

  VALUES('AAA')

Create a new report on this SQL table.

If you sort on the database-field {SortTest_Cod} directly, the order is correct as expected:

If I put the field in a formula and I sort on this formula, the order becomes incorrect:

Any ideas?

Patrick

Accepted Solutions (0)

Answers (1)

Answers (1)

abhilash_kumar
Active Contributor
0 Kudos

Hi Patrick,

There's a long discussion on the topic here.

It talks about how CR sorts a field that has dashes.

-Abhilash