locked
Date value condition in the fetch expression. RRS feed

  • Question

  • Hi All,

     

    Can we have  conditions in a fetch xml on datetime basis apart from the default once given by in the crm 2011 like 

    last-seven-days,next-seven-days,last-week,"this-week" ,"next-week","last-month","this-month","next-month","on","on-or-before" ,"on-or-after","last-year","this-year","next-year","last-x-hours","next-x-hours","last-x-days","next-x-days","last-x-weeks","next-x-weeks","last-x-months","next-x-months","olderthan-x-months","last-x-years","next-x-years".

    I need to build a fetch query to retrieve activities for a particular month for a specified year. 

    We tried out an alternative by using <all-attributes/> with out any condition in the fetch query and later we try to filter records on the month basis in "Expression" tag for a cell in SSRS like "=Count((Month(Fields!createdon.Value) ="9"))" but it turned out to be vain. 

    Regards,

    Jaipal Vallabhaneni. 


    Tuesday, December 20, 2011 10:53 AM

Answers

  • I got a solution for this . One need to build two datasets each with a different query and the columns needs to be merged in the report. Even couple of coumns needs to be hidden for this.

     

    Regards,

    Jaipal.

    Tuesday, December 27, 2011 4:50 AM

All replies

  • Hi,

    You can use On or Before and On or After condition i.e. if you want to fetch June 2011 activities then you can use it like: (off-course download the fetchXml from Advance Find and can use Created On or Due Date as per required)


    Jehanzeb Javeed

    http://worldofdynamics.blogspot.com
    Linked-In Profile |CodePlex Profile

    If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".


    • Edited by Jehanzeb.Javeed Tuesday, December 20, 2011 12:27 PM Added FetchXml download refrence
    Tuesday, December 20, 2011 12:15 PM
  • you can use 

    <filter type="and"> <condition attribute="createdon" value="2011-12-01" operator="on-or-after"/> <condition attribute="createdon" value="2011-12-31" operator="on-or-before"/> </filter>

     

    change the value from begin and end of month

     


    Thomas T(MCBMSS) If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".
    Tuesday, December 20, 2011 12:17 PM
  • Thomas thanks for the information , but  we already happen to explore this option earlier . i  need to filter this in the report dynamically , issue that we are facing is we  have 3 columns which are based on the activites only and each column we need to show the data for a given particular month and year.

    The report should be some what like this. 

    Activity

    Jun-10

    Jun-11

    Jun-12

    Difference 12-10

    Email

    47

    56

    112

    -65

    Phone Calls

    537

    659

    460

    77

    Fax

    0

    0

    0

    0

    Appointment

    0

    3

    1

    -1

    Other

    0

    0

    0

    0

    Total

    599

    729

    586

    13

    Regards,

    Jaipal 


    Tuesday, December 20, 2011 12:40 PM
  • I got a solution for this . One need to build two datasets each with a different query and the columns needs to be merged in the report. Even couple of coumns needs to be hidden for this.

     

    Regards,

    Jaipal.

    Tuesday, December 27, 2011 4:50 AM