Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi,
I used an SQL statement to get the data from a stored procedure. In this statement i use a date field and works fine when i use a variable as startdate.
The variable (startdate) is defined as:
#date(2018, 3, 6) meta [IsParameterQuery=true, Type="Date", IsParameterQueryRequired=true]
Now i want that the default date (2018, 3 ,6) changed to the present date. How can i do this?
when i use "DateTime.Date(DateTime.LocalNow())" for the date, the syntax doen't work
With kind regards,
The stored procedure is: exec storedprocedure '2018-03-07', '2018-03-07'
the 2 dates must be default the date of today (Startdate and Enddate)
for these dates I made a variabele and implemented it in de sourcecode:
Source = Sql.Database("xx", "xxx", [Query="exec storedprocedure '"&Date.ToText(Startdate"yyyyMMdd")&"', '"&Date.ToText(Endate,"yyyyMMdd")])
But now i have to change everyday the variable to the date of today. How can i change this default?
Startdate = #date(2018, 3, 7) meta [IsParameterQuery=true, Type="Date", IsParameterQueryRequired=true]
The syntax for "DateTime.Date(DateTime.LocalNow())" looks good, it returns todays date.
Maybe it's in the wrong format for your stored procedure?
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
97 | |
77 | |
63 | |
55 |
User | Count |
---|---|
143 | |
109 | |
89 | |
84 | |
66 |