9 Replies Latest reply on Oct 29, 2018 12:08 PM by Ivan Young

    How to sort string Date field

    pavitra k

      I would like to sort string date field where max(order_date) should be named always as "Current Date" and then rest of the dates as decending order_dates of the "order date"

       

      Order_date: Calc

      if str([ORDER_DATE])=str({fixed : max(([ORDER_DATE]))})

      then 'Current Date'

      ELSE

      iif(len(str(datename('day',[ORDER_DATE])))=1, '0'+str(datename('day',[ORDER_DATE])),str(datename('day',[ORDER_DATE]))) +'-'+left(str(datename('month',[ORDER_DATE])),3)+'-'+

      right(str(datepart('year',[ORDER_DATE])),2)

      END

       

      Capture4.PNG