September 11, 2010  
Register   Login  
Forum  
 
ForumForumEnesys RS Data ...Enesys RS Data ...Support - RS Da...Support - RS Da...Sharepoint items - modified the last xx hoursSharepoint items - modified the last xx hours
Previous Previous
 
Next Next
New Post
 4/23/2009 12:20 PM
 

 

Hello all,

what I am trying to do is to create a CAML query in order to retrieve items from a SharePoint List where they have modified the last xx hours.

Then I want to make email subscriptions in order to send this report daily at 20:00.

In this report I want to include all the Listitems that are from 20:01 previous day - 20:00 Today.

I tried to use the CAML below:

 

<Where>
    <And>
        <Eq>
            <FieldRef Name="Area"/>
            <Value Type="Text">Med/BSea</Value>
        </Eq>
        <Geq>
            <FieldRef Name='Modified'/>
            <Value Type="DateTime"><Today IncludeTimeValue='TRUE' OffsetDays="-1"/></Value>
        </Geq>
    </And>
</Where>

 

but unfortunately I could get the right items. I could all the items from the previous day (the whole day - not from 20:00 and laeter)

Then, I replaced the "Today" --> "Now" but I did not get any record at all.

Any Ideas??

 

 

 

 

New Post
 4/23/2009 6:13 PM
Accepted Answer 

 

Hi,

The following description shows a possible approach for doing what you want to do. It involves the use of two internal Report’s parameters for specifying the starting and ending dates. Users running a report will not be prompted to enter a value for Internal Report’s Parameters.

Here is the query part that will let you filter your items between two dates:

 

 image  

Please note that when running the query in the data view, you will be prompted to enter values for the two parameters. This is an expected behavior because at this stage you are only executing the query and not the report. Therefore the report’s parameters are not passed to the query. For a query, dates parameters have to be entered in the following forma: AAAA-MM-YYThh:mm:ss (eg: 2009-04-01T10:00:00).

Now to the report’s parameters:

The report’s parameters should have been created automatically (under the hood, BIDS will ask Enesys RS Data Extension for query’s parameters and create corresponding report’s parameters, which makes senses).

Select Reports and Report Parameters in the menu.

You should get a dialog box similar as the following screen shot:

image

Set the Data type of both parameters to DateTime.

Check Internal.

Move up EndDate before StartDate (because StartDate formula will depends on EndDate’s value).

And set an expression as the default value:

  • for EndDate parameter: =Today().AddHours(20).AddMinutes(02)
    This will return the date of the current day at 8:02 PM
  • for StartDate parameter : =DateAdd("d",-1,Parameters!EndDate.Value)
    This will return the EndDate minus one day.

Let me know if you have any questions.

Regards,


Luc Naudin Enesys
Previous Previous
 
Next Next
ForumForumEnesys RS Data ...Enesys RS Data ...Support - RS Da...Support - RS Da...Sharepoint items - modified the last xx hoursSharepoint items - modified the last xx hours

 
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