microsoft / microsoft/Power-Fx
Lookup of SQL Datasource with >= Date Comparison Errors
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 3.4k
- Forks
- 358
- Avg merge
- 10h 34m
- Merged PRs (30d)
- 3
Description
I'm experiencing the issue described here. This is my code:
UpdateContext({
note: LookUp(SiteHistory, CreatedDate >= Today())
});
which gives the not so helpful error:
Service call was successful. However, there was a problem processing the server response. Please refresh your data source and republish the app
This code does not error:
UpdateContext({
note: LookUp(SiteHistory, CreatedDate = Today())
});
but obviously returns blank since the created date will have a time portion.
Is there a work around for this, or potentially a way to fix it? If not, can the error give a more specific error?
UPDATE
Changing the code to this:
UpdateContext({
note: First(Sort(Filter(SiteHistory, CreatedDate >= Today()),
CreatedDate, Descending)
)
});
If(note.CreatedDate < Today(),
UpdateContext({
note: Blank()
});
);
Gives a much better error:
The requested operation is invalid.
Server Response: SiteHistory failed: We cannot apply operator < to types DateTimeZone and DateTime.
inner exception: We cannot apply operator < to types DateTimeZone and DateTime.
clientRequestId: f7d704ae-cd33-42bc-8d17-bebc1779ea79
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the LookUp(SiteHistory, CreatedDate >= Today()) expression against the SQL datasource, then compare it with the equality and updated Filter/Sort examples in the issue. Trace the resulting server-response and DateTimeZone-versus-DateTime errors; done means the comparison either works for the datasource or reports a specific, actionable diagnostic.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- sql
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100