Greeting everyone
i'm trying to get year and comparing
select sum(TransactionCurrencyAmount) from generalJournalAccountEntry2 where generalJournalAccountEntry2.MainAccount==MainAccount::findByMainAccountId(_mainAccount).RecId join generalJournalEntry where generalJournalEntry.RecId == generalJournalAccountEntry2.generalJournalEntry && year(generalJournalEntry.AccountingDate) ==year(fromDate) join ledger where ledger.RecId==generalJournalEntry.Ledger && ledger.Name==companyListIterator2.value() join fiscalCalendarPeriod where fiscalCalendarPeriod.RecId == generalJournalEntry.FiscalCalendarPeriod && fiscalCalendarPeriod.Type==FiscalPeriodType::Opening;
how can i solve that?!
I would get dates for the beginning and the end of the year and compare the date with them. For example:
int year = year(fromDate); select ... && generalJournalEntry.AccountingDate >= mkDate(1, 1, year) && generalJournalEntry.AccountingDate < mkDate(1, 1, year 1)
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156