Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics GP (Archived)

Date functions in Smartlist Builder

Posted on by Microsoft Employee

I have created a Smartlist that gives me the sales per customer per Months. How can I get the sales in the same report for the same months but from the previous year?

*This post is locked for comments

  • Suggested answer
    L Vail Profile Picture
    L Vail 65,271 on at
    RE: Date functions in Smartlist Builder

    Hi,

    Like Jeff and Mahmoud suggested, a view is probably your best bet. Routinely, however, I have to create SmartLists I can send to other people, so I need to create it inside SLB. Below is an example of the SQL code that you could use in your calculated field to find the first day in July of the previous year:

    select DATEADD(m, 6, DATEADD(yy, DATEDIFF (yy, 0, DATEADD(yy, -1, GETDATE())), 0))

    Replace 'GETDATE' with your data field. Use your date field, parse the month out of it and then subtract one from the resulting 'month' number.

    Change the '6' as follows to get the different months.

    January = 0

    February = 1

    March = 2

    April = 3

    May = 4

    June = 5

    July = 6

    August = 7

    September = 8

    October = 9

    November = 10

    December = 11

    Kind regards,

    Leslie

  • Suggested answer
    Mahmoud Saadi Profile Picture
    Mahmoud Saadi 32,738 on at
    RE: Date functions in Smartlist Builder

    To me, the best option is to create your view on the SQL management studio taking into consideration all the required data you want, then get the view published to Smart list builder as mentioned above by Mr. Jeff.

    Although, you can still use a various functions in Smart list builder to manipulate the data as requested. A list of functions (including Date functions) is illustrated in the knowledge base article below;

    List of the Functions that You can Use for Calculations in SmartList Builder, Excel Report Builder, Navigation List Builder, and Extender in Microsoft Dynamics GP

    In addition, you may refer to the article published by Dynamics GP Support and Services blog on the link below;

    Calculated Fields in Extender and the Builders

    Hope this helps out in your inquiry,

  • Suggested answer
    Jeff LaPointe Profile Picture
    Jeff LaPointe 1,022 on at
    RE: Date functions in Smartlist Builder

    You could make a SQL view and base your SmartList on the view.

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,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans