Skip to Content
0
Feb 11, 2014 at 01:39 PM

Bug with sorting on a formula

26 Views

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

Attachments

crok.png (13.3 kB)
crok1.png (12.4 kB)