Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Page Tree
rootCool Tips and Tricks

RequirementExplanation (Optional)Solution
Need to identify the first or last order date each month?

This elegant solution first truncates each day in each month back to MM/YYYY and then identifies the Max or Min date.

Functionally identical to a scoped Window_Max or an SQL Max(Order_Date) Over(Partition By DatePart...


Code Block
languagesql
{Fixed DateTrunc('month',[Order Date]) : Max([Order Date])}