Hi all,
I am trying to fetch record based on the 3 date fields which falls in last week from now.
Please provide me an SSRS expression or SQL Query for this requirement.
*This post is locked for comments
Hi all,
I am trying to fetch record based on the 3 date fields which falls in last week from now.
Please provide me an SSRS expression or SQL Query for this requirement.
*This post is locked for comments
Hi Sachith, thanks for responding. I've used both the queries to test and i had to modify your code to below updated one.
<fetch distinct="false" mapping="logical" output-format="xml-platform" version="1.0">
<entity name="opportunity">
<attribute name="name"/>
<order descending="false" attribute="name"/>
<filter type="and">
<condition attribute="actualclosedate" operator="last-seven-days"/>
<condition attribute="finaldecisiondate" operator="last-seven-days"/>
<condition attribute="actualclosedate" operator="today"/>
<condition attribute="finaldecisiondate" operator="today"/>
</filter>
</entity>
</fetch>
Below is the SQL Query:
SELECT Date1, Date2, Date3 FROM Table_Name WHERE Date1 >= DATEADD(day,-7, GETDATE()) OR Date2 >= DATEADD(day,-7, GETDATE()) OR Date3 >= DATEADD(day,-7, GETDATE())
Hi Vignesh,
How about this?
<fetch distinct="false" mapping="logical" output-format="xml-platform" version="1.0"> <entity name="opportunity"> <attribute name="name"/> <order descending="false" attribute="name"/> <filter type="and"> <condition attribute="actualclosedate" operator="last-seven-days"/> <condition attribute="finaldecisiondate" operator="last-seven-days"/> <condition attribute="createdon" operator="last-seven-days"/> </filter> </entity> </fetch>
Replace the date fields with your date fields; also change the filter type to "or" instead of "and" if that is the requirement.
Are you even trying to think of that?
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,280 Super User 2024 Season 2
Martin Dráb 230,214 Most Valuable Professional
nmaenpaa 101,156