cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
RaviSheth
New Member

invoking Custom function

Hello, Everyo

I was trying to Fetch Data from Stock Site for particular Symbol for a Period of Time.

I have Created the Function Name "FromDate" & "ToDate" for that, But the query returns expression error (as shown in Attached Image).

 

please anyone can help me with this. I am Novice in Coding Languages.

Untitled2.pngUntitled.png

2 REPLIES 2
SteveYao
Community Support
Community Support

Hi @RaviSheth 

 

Could you check your formula? It seems the left and right operand are not the same type, you cannot use & with Text and Table

Hello Steve,
 
thank you for your quick response.
 
I want to Make change in Following sentence 
 
In Highlighted Place I want to use Function Which uses date data type.
 
Source = Csv.Document(Web.Contents("https://www.nseindia.com/api/historical/cm/equity?symbol="&Symbol()&"&series=[%22EQ%22]&from=14-12-2019&to=14-06-2020&csv=true"
 
following are the way I have created this two function 
 
1.I have created two table named FromDate & ToDate with date data type and formatted in exactly the way highlighted text are.
 
2. Turned it into a Function through advance editor
 
Now ToDate use TODAY() function of excel to extract todays date & FromDate gets data by (Duration in Day - ToDate)
 
so how would I use this two Function in above sentence to get exact data.
 
Source = Csv.Document(Web.Contents("https://www.nseindia.com/api/historical/cm/equity?symbol="&Symbol()&"&series=[%22EQ%22]&from="&FromDate()&"&to="&ToDate()&"&csv=true"
 
this is what I have tried but retuned Expression error as You have mentioned we can't use & in Text and date.
I have also tried without & and without ""this also. but it didn't get desired results. i have tried everything on net and books but not able to get the answers.
 
please help.
 
thanks

Helpful resources

Announcements
October Events

Mark Your Calendars

So many events happening this month - don't miss out!

 WHAT’S NEXT AT MICROSOFT IGNITE 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Register for a Free Workshop.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Users online (2,613)