Forum Discussion
Converting Text into Date
- 8 years ago
Yes, the first double quotes of the table name must be preceded by a hash: #
#"Inserted T" = Table.TransformColumns(#"_RSALL_FULL_PERNR-USERS",{{"Last Executed On", each if _ = "0" then null else Text.Insert(_,8,"T"), type text}}),
The first parameter of Table.TransformColumns must be the name of the table (without field reference).
The field is the first element of the part between the double curly brackets.
The corrected code for the #"Insterted T" step:
#"Inserted T" = Table.TransformColumns("_RSALL_FULL_PERNR-USERS",{{"Last Executed On", each
if _ = "0" then null else Text.Insert(_,8,"T"), type text}}),
You are right about the added comma. Apologies, I just forgot about it.
Hi Marcel,
Thanks again!
I replaced the code, and now it looks like this:
let
Source = Access.Database(File.Contents("Z:\Corporate\GRC\FullRiskAnalysis.accdb"), [CreateNavigationProperties=true]),
#"_RSALL_FULL_PERNR-USERS" = Source{[Schema="",Item="RSALL_FULL_PERNR-USERS"]}[Data],
#"Inserted T" = Table.TransformColumns("_RSALL_FULL_PERNR-USERS",{{"Last Executed On", each if _ = "0" then null else Text.Insert(_,8,"T"), type text}}),
#"Changed Type" = Table.TransformColumnTypes(#"Inserted T",{{"datetime", type datetime}})
in
#"Changed Type"
However, it is showing the following error message:
"Expression.Error: We cannot convert the value "_RSALL_FULL_PERNR-US..." to type Table.
Details:
Value=_RSALL_FULL_PERNR-USERS
Type=Type"
Any thoughts?
Thanks in advance
- MarcelBeug8 years agoCommunity Champion
Yes, the first double quotes of the table name must be preceded by a hash: #
#"Inserted T" = Table.TransformColumns(#"_RSALL_FULL_PERNR-USERS",{{"Last Executed On", each if _ = "0" then null else Text.Insert(_,8,"T"), type text}}),- Borghi8 years agoAdvocate I
It worked!
Thank you so much!