SqlBldr.OrderbyFields.Add('table','field') Question
Hi,
I have a DateTime field in my database and I want to sort on the date
component of that field. The sort order is determined through user input so
I want to use SQLBuilder in RAP to set the sort order.
I have verified the output using an expression in the Calc tab of DADE,
Cast(DateTime as Date), and sorting on that field. I have also verified my
RAP SQLBuilder code by sorting on a different field.
When I use the cast function in OrderbyFields method, the report is not
sorted. Is there a way to add the desired sort order via SQLBuilder?
--
Bob
I have a DateTime field in my database and I want to sort on the date
component of that field. The sort order is determined through user input so
I want to use SQLBuilder in RAP to set the sort order.
I have verified the output using an expression in the Calc tab of DADE,
Cast(DateTime as Date), and sorting on that field. I have also verified my
RAP SQLBuilder code by sorting on a different field.
When I use the cast function in OrderbyFields method, the report is not
sorted. Is there a way to add the desired sort order via SQLBuilder?
--
Bob
This discussion has been closed.
Comments
I would try using the AddByIndex method. Once you add the Calc field I think
it will become the last field in the available list.
liCalcField := lSQLBuilder.OrderByFields.AvailableCount-1;
lSQLBuilder.OrderByFields.AddByIndex(liCalcField);
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com