May 19, 2012  
   Login  
Forum  
 
ForumForumEnesys RS Data ...Enesys RS Data ...Support - RS Da...Support - RS Da...How to Query on Calculated Columns from Document Library?How to Query on Calculated Columns from Document Library?
Previous Previous
 
Next Next
New Post
 3/3/2009 10:28 AM
 
 Modified By Ondeo_UK  on 3/3/2009 11:30:04 AM

I have a document library which has a calculated column (in a date format) and I am unable to query using this.

What I need to do is to report on which documents are due to be reviewed based columns added to the library.

  • Issue Date [Date]
  • Review Period [Number]
  • Next Review Date [Calculated Date = Issue Date + (Review Period*365) ]

When I use the Query Builder this field has a value type of 'Calculated' and appears to operate like a text value rather than a date value and so I can't compare against a given date correctly.

<query>

 

<Where>

 

<Leq>

 

<FieldRef Name="Next_x0020_Review_x0020_Date" />

 

<Value Type="Calculated">date('now')</Value>

 

</Leq>

 

</Where>

 

</query>

 

 

How can I read the calculated column as a date value and be able to query properly

 

Thanks

 

 

 

New Post
 3/3/2009 11:11 AM
 

I've managed to answer my own question as follows.

    <query>
      <Where>
        <Leq>
          <FieldRef Name="Next_x0020_Review_x0020_Date" Type="DateTime" />
          <Value Type="DateTime" IncludeTimeValue="TRUE"><Today/></Value>
        </Leq>
      </Where>
    </query>

Thanks

New Post
 3/4/2009 9:30 AM
 

Hi,

Glad you could solve the problem.

Will add a bug in our database so that calculated columns default to their target data type rather than "calculated".

Regards,


Frederic LATOUR
ENESYS
New Post
 5/5/2009 10:48 PM
 

Frederic,

Here is another instance of the use of a Calculated Column, When I preview or deploy the report the parameter drop down is empty:

<?xml version="1.0" encoding="utf-8"?>
<root xmlns="http://enesyssoftware.com/schemas">
  <queryName></queryName>
  <description></description>
  <list title="Pakistan Review Comments" relativeSiteUrl="/ipoms/ipomsqa/" tableName="Pakistan Review Comments">
    <fields>Track,Lesson,Document_x0020_Type,Comment_x0020_Category,Page_x0020_or_x0020_Slide_x0020_,Comment,Status,SME_x0020_Comment,Commnet_x0020_Action,Report,Track</fields>
    <query>
      <Where>
        <Eq>
          <FieldRef Name="ReportTrack" />
          <Value Type="Calculated">@track!</Value>
        </Eq>
      </Where>
    </query>
  </list>
  <resultSet>Pakistan Review Comments</resultSet>
</root>

If I remove the query, all items show in the drop down......

Thanks, Bill

New Post
 5/6/2009 9:50 AM
 

Hi Bill,

If I understand correctly what you want, you want to have the parameter drop down list to be filled with all the values available in the list. Then, you select a value from the drop down list to get only items where "ReportTrack" is equal to the selected value?

If it's the case, you will need to have two datasets:

  1. The first dataset will query the list and return all the "ReportTrack" values available in this list.
  2. The second dataset will be the one you give us just above. The "track" parameter's available values should be filled by the values of the "ReportTrack" column from the first dataset. For more information, you can see the "In Operator" report sample provided as part of the solution.
    In this report, the "param" parameter's values are filled by the values returned by the "DistinctCategories" dataset.

Regards,
Marien MONNIER
Enesys

Previous Previous
 
Next Next
ForumForumEnesys RS Data ...Enesys RS Data ...Support - RS Da...Support - RS Da...How to Query on Calculated Columns from Document Library?How to Query on Calculated Columns from Document Library?

 
You need to login for posting to the forums.
If you don't have a login, click here to register.
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