February 10, 2012  
   Login  
Forum  
 
ForumForumEnesys RS Data ...Enesys RS Data ...Support - RS Da...Support - RS Da...Date Range Parameters and SyntaxDate Range Parameters and Syntax
Previous Previous
 
Next Next
New Post
 10/7/2008 4:29 PM
 

Desperately need some help with syntax.  Is the following correct?  I am trying to build a multi-parameter reports which takes in a begin date and end date for the modified value (this is the OOTB modified field associated with a list item) and then another parameter based on a column called Affiliations.  Also, what format do I need to put my dates into - the documentation said YYYY-MM-DDTHH:MM:SS but when I use this format I get an error back from RS that this string is not a recognized date format.  Thanks in advance.

<?xml version="1.0" encoding="utf-8" ?>

<root>
 <list title="Contacts" relativeSiteUrl="/" tableName="results" useDisplayName="true" expandRecurrent="true" expandFirstDate="@StartDate!" expandLastDate="@EndDate!">
<fields>Roles, Title, Last Name, First Name, Middle Name, Email, User Type, Affiliations, Address, City ,State/Province, ZIP/Postal Code, Business Phone, Company, Job Title, Deactivate, Created, Modified,Modified By, Source</fields>
 <query>
<Where>
<And>
<Geq><FieldRef Name="Modified"/><Value Type="DateTime">@StartDate!</Value></Geq>
<Leq><FieldRef Name="Modified"/><Value Type="DateTime">@EndDate!</Value></Leq>
</And>
<Contains><FieldRef Name="Affiliations"/><Value Type="Text">@Affiliations!</Value></Contains>
</And>
</Where>
</query>
</list>
</root>

 

 

New Post
 10/7/2008 5:19 PM
 
 Modified By Frédéric LATOUR  on 10/7/2008 4:20:06 PM

Hi,

an "And" element is missing from the query (just below the Where) but maybe is it just a copy and paste problem:

<?xml version="1.0" encoding="utf-8" ?>

<root>

  <list title="Contacts" relativeSiteUrl="/" tableName="results" useDisplayName="true">

    <fields>Roles, Title, Last Name, First Name, Middle Name, Email, User Type, Affiliations, Address, City ,State/Province, ZIP/Postal Code, Business Phone, Company, Job Title, Deactivate, Created, Modified,Modified By, Source</fields>

    <query>

      <Where>

        <And>

          <And>

            <Geq>

              <FieldRef Name="Modified"/>

              <Value Type="DateTime">@StartDate!</Value>

            </Geq>

            <Leq>

              <FieldRef Name="Modified"/>

              <Value Type="DateTime">@EndDate!</Value>

            </Leq>

          </And>

          <Contains>

            <FieldRef Name="Affiliations"/>

            <Value Type="Text">@Affiliations!</Value>

          </Contains>

        </And>

      </Where>

    </query>

  </list>

</root>

I have also removed the expandRecurrent attribute that will be ignored anyway (only used for recurring events in event lists).

Now for the date parameters, you should set your report's parameters to type "datetime" and the dates will be automatically converted as necessary for the query when running the report.

However, when running the report in the dataview, the parameter's dialog box that pops up will only let you enter parameters in string format. Therefore, in that case, you will have to specify the date in the format you mentioned: YYYY-MM-DDTHH:MM:SS.

Hope this clarifies. Let me know if you can't run the modified query.

Regards,


Frederic LATOUR
ENESYS
Previous Previous
 
Next Next
ForumForumEnesys RS Data ...Enesys RS Data ...Support - RS Da...Support - RS Da...Date Range Parameters and SyntaxDate Range Parameters and Syntax

 
You need to login for posting to the forums.
If you don't have a login, click here to register.
 
Copyright 2010 Enesys - All rights reserved Terms Of UsePrivacy Statement