Home DADE

SelectGroupByField

edited October 2002 in DADE
Is it possible to use TdaSQL.SelectGroupByField to add a group by clause
using an expression rather then a field.

Thanks

-Jack

Comments

  • edited October 2002
    No, DADE expects a field to be used as the GROUP BY. There is no support for
    the expression type group by. If you want to add a GROUP BY in code, then
    use:

    procedure TForm1.CreateGroupBy;
    var
    lSQL: TdaSQL;
    liIndex: Integer;
    begin

    {get SQL object}
    GetSQLObject(ppReport1, lSQL);

    lSQL.ClearGroupByFields;

    for liIndex := 0 to lSQL.SelectFieldCount - 1 do
    lSQL.AddGroupByField(lSQL.SelectFields[liIndex]);

    end;

    If you want to use an expression, the you'll have to modify the SQLText.
    Set TdaSQL.EditSQLAsText = True, then you can modify the TdaSQL.SQLText
    property.

    Cheers,

    Jim Bennett
    Digital Metaphors

This discussion has been closed.