Forum Discussion

jrduboue's avatar
jrduboue
New Member
9 years ago
Solved

Converting specific text to date in PowerQuery

Hello all,   I have a text column with dates in the current format: "mddyyyy" or "mmddyyyy" or "0" (to indicate no date in the cell). Can I get assistance with how to convert these text strings int...
  • v-caliao-msft's avatar
    9 years ago

    Hi jrduboue,

     

    You can use Date.FromText to achieve this requirement. It returns a Date value from a set of date formats and culture value, following ISO 8601 format standard.
    Date.FromText(date as nullable text, optional culture as nullable text) as nullable date 

    Supported formats

    • yyyy-MM-dd

    • YYYYMMDD

    • M/d/yyyy

    Reference
    https://msdn.microsoft.com/en-us/library/mt260703.aspx

     

    Regards,

    Charlie Liao