Home RAP
New Blog Posts: Merging Reports - Part 1 and Part 2

SqlBldr.OrderbyFields.Add('table','field') Question

edited November 2005 in RAP
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

Comments

  • edited November 2005

    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
This discussion has been closed.