
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)