Forum Discussion

Thigs's avatar
Thigs
Icon for Helper IV rankHelper IV
4 years ago
Solved

Super Weird Time Column

Hi all,  I have some data from a client with a time column, only it is strange. Basically, it goes HHMMSS, however, if the beginning digits are zero, they disappear. EX - if the time should be 01223...
  • OwenAuger's avatar
    4 years ago

    Hi Thigs 

    First off, it looks like you are missing the square brackets on some of your references to the Time column, which is likely the cause of the error.

     

    Secondly, you can simplify the code by using Text.PadStart.

    The code in the Custom Column dialog box would look like:

    Custom Time
    = Text.PadStart( [Time], 6, "0" )

     

    I'm assuming Time is a text column by the way.

     

    Regards,

    Owen