Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Extract month and year from code when exporting to excel to get dynamics report

Posted on by Microsoft Employee

Hello my friends,

I am quite new and I need yourt help. Let say that I have in CRM the date, when the item was createdy, and I want to extract month and year. 

So Is there a way to do this right in CRM 2011?

And if I created a dynamics list in xml format a I have the date there, is there a way to extract it right in the code in Excel? 

Bellow see the example:

Select "new_etapa0".createdon as "createdon", extract(year from "new_etapa0".createdon), extract(month from "new_etapa0".createdon) .....

Thank you in advance for your help!

Jiri Beran

*This post is locked for comments

  • Suggested answer
    StefanS365 Profile Picture
    StefanS365 3,573 Most Valuable Professional on at
    RE: Extract month and year from code when exporting to excel to get dynamics report

    Hi Jiri,

    You could use the Date Time Workflow Utilities from Jason Lattimer as well to extract month and year.

    github.com/.../CRM-DateTime-Workflow-Utilities

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Extract month and year from code when exporting to excel to get dynamics report

    Hello,

    thank you for your reply, but I needed done it into code.  Since you have f.e. 50 000 rows of data and you need add more columns, it will make your Excel file very slow.

    Thank you for your time!

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Extract month and year from code when exporting to excel to get dynamics report

    Hello,

    You can create two more columns(Year, Month) in your excel sheet and the provide formula to them. then map these fields in import

    8244.2018_2D00_11_2D00_28_5F00_13_2D00_47_2D00_16.png

    Hope you can understand.

    Thanks

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