Forum Discussion
Import from web - dynamic year today range
Dear All!
I would like to ask for your help with the following case.
I have a website to import data from on daily basis.
Importing data from a specific date till today. I have the problem with the today part.
Please change your Source line to this.
Source = Web.BrowserContents("https://www.mnb.hu/arfolyam-tablazat?deviza=rbCurrencyActual&devizaSelected=ZAR&datefrom=2022.02.12.&datetill=" & Date.ToText(Date.From(DateTime.LocalNow()), "yyyy.MM.dd.") & "&order=1"),
Pat
6 Replies
- mahoneypatMicrosoft Employee
You can use this expression to get the current date in the needed format. You can either concatenate it into your string, or create it in a separate variable and use that.
= Date.ToText(Date.From(DateTime.LocalNow()), "yyyy.MM.dd")
Pat
- AnonymousNot applicable
Hi mahoneypat !
The "yyyy.MM.dd" part is giving me a Token Comma Expected error.
Any idea, what might have gone worng?
Thank you
S
- mahoneypatMicrosoft Employee
Please post your entire M code from the Advanced Editor. Also, I forgot the last . in your date format but you can easily add that.
Pat