24.11.2006, 11:48 | #1 |
Гость
|
В запросе "слиплись в кучу измерения", как выйти из положения?
Добрый день. Код, объяснения потом
X++: qbds = q.addDataSource(tablenum(LedgerJournalTrans)); qbds.fields().addField(fieldNum(LedgerJournalTrans,AmountCurDebit),SelectionField::Sum); qbds.fields().addField(fieldNum(LedgerJournalTrans,AmountCurCredit),SelectionField::Sum); qbds.addSortField(fieldid2ext(fieldnum(LedgerJournalTrans,dimension),SysDimension::Department)); qbds.addSortField(fieldid2ext(fieldnum(LedgerJournalTrans,dimension),SysDimension::Center)); qbds.addSortField(fieldid2ext(fieldnum(LedgerJournalTrans,dimension),SysDimension::Purpose)); qbds.orderMode(OrderMode::GroupBy); qr = new QueryRun(q); Цитата:
Описание ошибки SQL: [Microsoft][ODBC SQL Server Driver][SQL Server]A column has been specified more than once in the order by list. Columns in the order by list must be unique.
Оператор SQL: SELECT SUM(A.AMOUNTCURDEBIT),SUM(A.AMOUNTCURCREDIT),A.DIMENSION,A.DIMENSION2_,A.DIMENSION3_,A.DIMENSION4_,A.DIMENSION5_,A.DIMENSION6_ FROM LEDGERJOURNALTRANS A(NOLOCK) WHERE ((DATAAREAID=?) AND ((TRANSDATE>=?) AND (TRANSDATE<=?))) GROUP BY A.DIMENSION,A.DIMENSION2_,A.DIMENSION3_,A.DIMENSION4_,A.DIMENSION5_,A.DIMENSION6_,A.DIMENSION,A.DIMENSION2_ ORDER BY A.DIMENSION,A.DIMENSION2_,A.DIMENSION3_,A.DIMENSION4_,A.DIMENSION5_,A.DIMENSION6_,A.DIMENSION,A.DIMENSION2_ OPTION(FAST 5) X++: SysDimension::Department //первое измерение (нулевое) SysDimension::Center //второе SysDimension::Purpose //третье X++: qbds.addSortField(fieldid2ext(fieldnum(LedgerJournalTrans,dimension),SysDimension::Department)); Последний раз редактировалось Shakr; 24.11.2006 в 11:52. |
|