20.04.2006, 14:13 | #1 |
Участник
|
Сложный Query: непонятки с Enum-ами
Цель, создать вот такой вот Query
Код: while select ledgerJournalTrans where ledgerJournalTrans.TransDate == todayDate && ledgerJournalTrans.AccountType == LedgerJournalACType::Cust exists join ledgerJournalTransLink where (ledgerJournalTransLink.Voucher == ledgerJournalTrans.Voucher && ledgerJournalTransLink.TransDate == ledgerJournalTrans.TransDate )&& (ledgerJournalTransLink.AccountType == LedgerJournalACType::Bank || (ledgerJournalTransLink.AccountType == LedgerJournalACType::Cust && ledgerJournalTransLink.OffsetAccountType == LedgerJournalACType::Bank)) {...} Код: value = strfmt('((%1 == "%2") || ((%3 == "%4") && (%5 == "%6")))', fieldId2name(TableNum(LedgerJournalTrans), fieldNum(LedgerJournalTrans, AccountType)), queryValue(LedgerJournalACType::Bank), fieldId2name(TableNum(LedgerJournalTrans), fieldNum(LedgerJournalTrans, AccountType)), queryValue(LedgerJournalACType::Cust), fieldId2name(TableNum(LedgerJournalTrans), fieldNum(LedgerJournalTrans, OffsetAccountType)), queryValue(LedgerJournalACType::Bank)); linkedQbds.addRange(fieldNum(LedgerJournalTrans, DataAreaId)).value(value); Код: ... ((B.ACCOUNTTYPE=193) OR ((B.ACCOUNTTYPE=202) AND (B.OFFSETACCOUNTTYPE=193)))) ... |
|