Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hi all,
I have an API endpoint where I want to dynamically update the date to yesterday's date. However, the date needs to be in the format YYYY-MM-DD. This is my current attempt at doing this is by using this code:
Date.Year(DateTime.LocalNow()) & "-" & Date.Month(DateTime.LocalNow()) & "-" & Date.Day(DateTime.LocalNow()-1)
...in the context of the query it appears like this:
let
Source = Xml.Tables(Web.Contents("https://dataapi.xxxxxx.com/74daa799/v1/enterprise/73/events/xxxxxx/pages/created/2020-09-01;" & Date.Year(DateTime.LocalNow()) & "-" & Date.Month(DateTime.LocalNow()) & "-" & Date.Day(DateTime.LocalNow()-1) ))
in
Source
...when I run this I get the following error
Expression.Error: We cannot apply operator & to types Text and Number.
Details:
Operator=&
Left=https://dataapi.xxxxxx.com/74daa799/v1/enterprise/73/events/xxxxxx/pages/created/2020-09-01;
Right=2020
Can anyone suggest where I'm going wrong?
Thanks in advance,
Sam
Solved! Go to Solution.
Hi @Anonymous
The error message says you are trying to concatenate text and numbers. Convert the numbers to text with Text.From( ) or similar
Please mark the question solved when done and consider giving kudos if posts are helpful.
Contact me privately for support with any larger-scale BI needs, tutoring, etc.
Cheers
Hi @Anonymous
The error message says you are trying to concatenate text and numbers. Convert the numbers to text with Text.From( ) or similar
Please mark the question solved when done and consider giving kudos if posts are helpful.
Contact me privately for support with any larger-scale BI needs, tutoring, etc.
Cheers