Canadian Dates: Best buy and Production Date

  • Canadian Dates: Best buy and Production Date

    Posted by Ronald L McVicar Jr on September 10, 2018 at 3:58 pm
    • Ronald McVicar

      Member

      September 10, 2018 at 3:58 PM

      This is a reach out to the RDLC experts regarding Datetime data elements.
      we have a dataset in NAV that gives us a datetime.Ā  For all our US customers we useĀ  CDATE expression and format as we want.Ā  However for Canadian we are told we need to use letters for month instead of numbers: Ā JA, FE, MR, AL, MA, JN, JL, AU, SE, OC, NO, DE

      so instead of 190613 for June 13, 2018 we are to format 19JN13

      Any recommendations and examples?Ā 
      The following is what we thought we’d use but instead of numbers for month we have to use letters.

      =Format(CDATE(First(Fields!Label_Parameters__Expiry_Date_.Value, “DataSet_Result”)), “yyMMdd”)

      ——————————
      Ronald McVicar, IT Software Mgr
      NSP (Quality Meats)
      nspproteins.com
      ——————————

    • Suresh Kulla

      Member

      September 11, 2018 at 2:23 AM

      Ronald,

      You can use MMM to get the month name in three characters. for ex: JAN, FEB… but to get in to your format i recommend you add a custom function and pass the MMM value and return the 2 character.

      Something like below and your final expression could like

      =Format(CDATE(First(Fields!Label_Parameters__Expiry_Date_.Value, “DataSet_Result”)), “yy”) +Ā  GetMonth(Format(CDATE(First(Fields!Label_Parameters__Expiry_Date_.Value, “DataSet_Result”)), “MMM”)) +
      Format(CDATE(First(Fields!Label_Parameters__Expiry_Date_.Value, “DataSet_Result”)), “dd”)

      Public Shared Function GetMonth(ByVal MonthName As String) As StringĀ Ā Ā Ā 
      Ā Ā Ā Ā Ā Ā Ā  Select Case MonthNameĀ Ā Ā 
      Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā  Case JANĀ Ā Ā 
      Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā  Return “JN”Ā  Ā Ā 
      Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā  Case FEBĀ Ā 
      Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā  Return “FB”Ā Ā Ā 
      Ā  Ā  Ā  Ā  Ā  Ā 
      Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā  Case ElseĀ Ā Ā Ā 
      Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā  Return “”Ā Ā Ā 
      Ā Ā Ā Ā Ā Ā Ā  End SelectĀ Ā Ā Ā 
      Ā Ā Ā  End FunctionĀ Ā Ā Ā 

      ——————————
      Thanks
      Suresh Kulla
      NAV Technical Architect
      Atlanta GA
      ——————————
      ——————————————-

    • Ronald McVicar

      Member

      September 19, 2018 at 11:49 AM

      Suresh
      what a great recommendation. I use this in SQL scripting but not in SSRS (Report Builder: Expression).Ā  I’ll work on it.Ā  This should work.Ā  I believe.

      ——————————
      Ronald McVicar, IT Software Mgr
      NSP (Quality Meats)
      nspproteins.com
      ——————————
      ——————————————-

    Ronald L McVicar Jr replied 7 years, 7 months ago 1 Member · 0 Replies
  • 0 Replies

Sorry, there were no replies found.

The discussion ‘Canadian Dates: Best buy and Production Date’ is closed to new replies.

Start of Discussion
0 of 0 replies June 2018
Now

Welcome to our new site!

Here you will find a wealth of information created for peopleĀ  that are on a mission to redefine business models with cloud techinologies, AI, automation, low code / no code applications, data, security & more to compete in the Acceleration Economy!