Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

Employee joining date

Posted on by 102

Hi Guys

I am facing a problem getting employee joining date in DAX 2012 R3 HR module.

when get employee joining date by T-SQL query it show me one day previous(Back date) date in T-SQL result i.e AX date of joining =

empJoingDate.GIF

SQL date of joining  EmployeeDateOfjoiningTsql.GIF

please help me

*This post is locked for comments

  • Satish Panwar Profile Picture
    Satish Panwar 14,645 on at
    RE: Employee joining date

    Hi MAKDAX2012_Ahmed..If your question has been resolved, please take time to verify the answer.

  • Suggested answer
    Satish Panwar Profile Picture
    Satish Panwar 14,645 on at
    RE: Employee joining date

    select top 1 CREATEDDATETIME SQLTime,  

     CONVERT(datetime,

                  SWITCHOFFSET(CONVERT(datetimeoffset, CREATEDDATETIME),

    DATENAME(TzOffset, CREATEDDATETIME  AT TIME ZONE 'Pacific Standard Time')))

    AS UI_Time from CUSTTABLE where DATAAREAID = 'usmf'

    SQL time = 2013-01-03 11:58:40.000

    My timezone is pacific

    UI_Time - 2013-01-03 03:58:40.000 (D365 shows same).

    There are multiple ways of achieving the same result, you need to find which one you want to use.

  • Verified answer
    Sukrut Parab Profile Picture
    Sukrut Parab 71,647 Moderator on at
    RE: Employee joining date

    You used correct  SQL function  dateadd.

    SQL-  dateadd(hour, -8, assign.validTo)

    AX-  DateTimeUtil::newDateTime(DateTimeUtil::date(this.EmploymentValidTo),86399,Timezone::GMTMINUS0800PACIFICTIME);

  • MAKDAX2012_Ahmed Profile Picture
    MAKDAX2012_Ahmed 102 on at
    RE: Employee joining date

    any example please

  • MAKDAX2012_Ahmed Profile Picture
    MAKDAX2012_Ahmed 102 on at
    RE: Employee joining date

    i have solved by adddate(hour,5,validdate) from hcmemployement

  • Verified answer
    Satish Panwar Profile Picture
    Satish Panwar 14,645 on at
    RE: Employee joining date

    The date in SQL is in utc timezone. you need to apply timezone offset based on user and then you will get the correct date from T-sql.

  • Ludwig Reinhard Profile Picture
    Ludwig Reinhard Microsoft Employee on at
    RE: Employee joining date

    Hi,

    What exactly is the problem and what do you try to achieve exactly?

    Would be great if you could provide some additional information and write a bit more :-) to fully understand what the underlying issue is.

    Many thanks and best regards,

    Ludwig

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans