web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

getting year from Accounting Date

(0) ShareShare
ReportReport
Posted on by 2,050

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;

pastedimage1643290394351v2.png

how can i solve that?!

I have the same question (0)
  • Suggested answer
    Martin Dráb Profile Picture
    239,670 Most Valuable Professional on at

    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)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Abhilash Warrier Profile Picture

Abhilash Warrier 635 Super User 2026 Season 1

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 595 Super User 2026 Season 1

#3
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 557

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans