2016-04-21 31 views
1

使用Microsoft Excel 2016 - 查詢編輯器 - 高級編輯器。如何在Power Query中格式化日期? (Microsoft Excel 2016 - 查詢編輯器 - 高級編輯器?)

我不熟悉這種語言。

let 
    SettingsSheet = Excel.CurrentWorkbook(){[Name="Table2"]}[Content], 
    #"TimeRange" = Table.TransformColumnTypes(SettingsSheet,{{"From", type datetime}, {"To", type datetime}}), 
    From = #"TimeRange"[From], 
    #"To" = #"TimeRange"[To], 
    DateFormatString = "mm/dd/yy", 
    #"FormattedFrom" = Format(From,DateFormatString), 
    ... 
    (Further in the code I will need to build a URL string from it.) 

當我搜索語法格式日期轉換爲字符串,我總覺得這Format(...,...)功能,但我得到的錯誤信息

名「格式」無法識別。確保拼寫正確。

什麼是正確的語法?

+0

我看起來像被稱爲電源查詢語言。 – TTT

回答

1

語言是電話電力查詢。 我一直在尋找的表達是DateTime.ToText(DateTime, DateFormatString)(而不是Format(DateTime, DateFormatString))。

0

在電源查詢UI添加自定義列的語法是當...

= Date.ToText([日期], 「MMM」)