I want to create two parameters Date from and Date to, and I want to write a query so I first created dates StartDate and EndDate and I am getting the following error
can't convert from data type Record to Text". Do you know what's wrong with it?
and I had a code
let
Source = Sql.Database("Server\12", "Base1"),
Query = Value.NativeQuery(
Source,
[Query="EXEC [dbo].[sp_Sales] @DateFrom = '" & Date.ToText(StartDate) & "', @DateTo = '" & Date.ToText(EndDate) & "'"])
in
Query
let
Source = Sql.Database("Server\12", "Base1"),
Query = Value.NativeQuery(
Source,
[Query="EXEC [dbo].[sp_Sales] @DateFrom = """ & Date.ToText(StartDate) & """, @DateTo = """ & Date.ToText(EndDate) & """"])
in
Query