Home » BizTalk Server

Filter file based on date


I have a process that writes xml files to a share. BizTalk has a couple of subscribers to this file. I need to enhance some functionality here by promoting a datetime value within the file. Only if the current date is greater than the promoted value should the file be processed.

Any ideas?



5 Answers Found


Answer 1


One optionis is to have the check in custom pipeline component and promote a (boolean) property i.e. ProcessMessage.  Set its value to true if current date  is greater  than date value you want to compare and false otherwise.  Then you can use this  promoted  property (ProcessMessage) in your send port or orchestration to make decision whether to process  message or not.


Tariq Majeed


Answer 2


You can make a distinguished field in schema for the file. Distinguished fields are usefull when you want to make decisions or to manipulate data in an orchestration. The pipeline disassembler will insert a Written property into the message context for items that are marked as a distinguished field. This is usefull if you are working with an orchestration to process  the file. Other option is to use a promoted  property, as criteria for message routing. Which is available in an orchestration too. Files that need to be processed  are routed to a destination, where this happens (i.e. orchestration or target system). You can create promote properties in schema belonging file  or Tariq suggest not in schema, but in custom pipeline component. Note here that Distinguished fields and promoted properties have to always get Min/Max Occurs = 1. See also MSDN About Message Context Properties. You have a few options here to your scenario.



Steef-Jan Wiggers
MCTS BizTalk Server
If this answers your question please mark it accordingly




Answer 3

Hi Tariq,

Suppose the date  today+2 days. I need the file  to be processed  2 days later....

Not sure i can handle that with the boolean property


Answer 4


In that case you can use a store-and-forward principle, where you evaluate the date  using promoted  property or distinguished field (as discussed in previous posts). If file  does not have to be processed  than it is stored in database or folder and picked up or submitted the next day.



Steef-Jan Wiggers
MCTS BizTalk Server
If this answers your question please mark it accordingly



Answer 5

Yes..the store and forward is the only thing that will work. I am proceeding with that approach.



Creating a report in visual studios and want to filter out data based on a date field. Want to show the post that are 3 months back in time according to my date field.





I would like to create a view to a document library that is filtered by documents added to the library within the last 30 days. I was hoping this could be done by adding a condition to filter by a date modifed greater than [Today] - 30. However, I am getting an error for this.

Does anyone know how to do this?




I have a gridview, based on thsi datasource:


<asp:SqlDataSource ID="SqlDataSourceAllLoads" runat="server" 
        ConnectionString="<%$ ConnectionStrings:tplatz_dk_dbConnectionString %>"               
        SelectCommand="SELECT DISTINCT DATEADD(day, 0, DATEDIFF(day, 0, tblDelivered.delivered_Date)) AS delivered_Date, tblDelivered.delivered_LoadNo, tblDelivered.delivered_TrailerNo, ISNULL(tblDeliveredInfo.deliveryInfo_FirmaNavn, N'?') AS Expr1 FROM tblDelivered FULL OUTER JOIN tblDeliveredInfo ON tblDelivered.delivered_LoadNo = tblDeliveredInfo.deliveryInfo_LoadNr ORDER BY delivered_Date DESC">

Using a dropdownlist, I can filter (by changing datasource) the results based on customer names in a dropdownlist. This datasource, working perfectly, looks like this:


<asp:SqlDataSource ID="sqldataSourceKundeLoads" runat="server" 
        ConnectionString="<%$ ConnectionStrings:tplatz_dk_dbConnectionString %>" 
        SelectCommand="SELECT  DATEADD(day, 0, DATEDIFF(day, 0, tblDelivered.delivered_Date)) AS delivered_Date, tblDelivered.delivered_LoadNo, tblDelivered.delivered_TrailerNo, ISNULL(tblDeliveredInfo.deliveryInfo_FirmaNavn, N'?') AS Expr1 FROM tblDelivered FULL OUTER JOIN tblDeliveredInfo ON tblDelivered.delivered_LoadNo = tblDeliveredInfo.deliveryInfo_LoadNr WHERE (tblDeliveredInfo.deliveryInfo_FirmaNavn = @firmanavn) ORDER BY delivered_Date DESC">
            <asp:ControlParameter ControlID="DropDownListKunder" Name="firmanavn" 
                PropertyName="SelectedItem.Text" />


Now, using a textbox and a ajax calendar, I would like to be able to filter on the date as well, but my datasource so far:


<asp:SqlDataSource ID="SqlDataSourceDatoLoads" runat="server" 
        ConnectionString="<%$ ConnectionStrings:tplatz_dk_dbConnectionString %>" 
        SelectCommand="SELECT DATEADD(day, 0, DATEDIFF(day, 0, tblDelivered.delivered_Date)) AS delivered_Date, tblDelivered.delivered_LoadNo, tblDelivered.delivered_TrailerNo, ISNULL(tblDeliveredInfo.deliveryInfo_FirmaNavn, N'?') AS Expr1 FROM tblDelivered FULL OUTER JOIN tblDeliveredInfo ON tblDelivered.delivered_LoadNo = tblDeliveredInfo.deliveryInfo_LoadNr WHERE (DATEADD(day, 0, DATEDIFF(day, 0, tblDeliveredInfo.deliveryInfo_Dato)) = @dato) ORDER BY deliveryInfo_FirmaNavn ">
            <asp:ControlParameter ControlID="txtStartDate" Name="dato" 
                PropertyName="Text" Type="DateTime" />


doesn't  work very good. In some case sit doesnt show anything, in onther situations - with 10 records for a given date, it only shows one.



Question one: How do I make the last datasource work? Its probably - again-again - something with the datetime formats, but for the life of me, I can't see how to do.


Question two: The Ideal solution would be using the first datasource, SqlDataSourceAllLoads, and then be able to filter the results with filterexpressions/parameters, but again, how? The filterparameters would origin from a DropDownListKunder, matching the tblDeliveredInfo.deliveryInfo_FirmaNavn as seen in the second datasource, while the date comes from the textbox txtStartDate (databinding fired by a button), but is that possible? Probably yes...?




We are implementing a SharePoint list for our resources to provide information as to whether they will be in the office that day, working from home, etc..


All entries are supposed to be in by 8:30 am and a report is created at that time; however, there are always a few stragglers. 


I would like to create a view which shows all entries which have been created after 8:30 am of the current day.  I have tried the following:



is greater than





is greater than

=TEXT(Sum(DateValue([Today]),TimeValue("8:30 AM")),"m/d/yyyy h:MM:ss")




is greater than

=TEXT(([Today]+TimeValue("8:30 AM")), "m/d/yyyy h:MM:ss")




is greater than

=[Today]+TimeValue("8:30 AM")


They all result in “Filter value is not in a supported date format.”



SharePoint Designer is not supported for our SharePoint sites so I can not modify the CAML query to include IncludeTimeValue=”TRUE” for  [Today] (and I am not sure it would help me anyway).

Anyone have any suggestions for me?



I have a calendar view that I need to filter by start date based on a user submitted value.

I have tried the solution here: http://social.msdn.microsoft.com/Forums/en-US/sharepointcustomization/thread/081bc1c1-7a91-4aa2-81e7-a7ce2e880760,
which involved creating a new column in the content type with a calculated value based off of the Start Time, but it doesn't work and I can't seem to figure out why.

Upon successfully connecting the filter to the view and specifying a date, no rows are being displayed when they should.

That being said, if I set the filter to a null value - I CAN filter by using the dropdown menu on the Start Date column itself, so I know that A) The column is calculated correctly and B) The values do exist.

Thank you!


I am linking (merging) multiple document libraries across a site collection and displaying the results in a data view webpart on our home page, in hopes of being able to display newly uploaded documents (documents uploaded today or within the past 48hrs - I am still awaiting the specific requirements for this).

At this time, I have linked 3 document libraries with the columns (Name, Created By, and Created) and displayed them in a data view webpart. I have tried to filter based on Created = Today and have tried numerous options with no luck. The webpart is just not showing any data. I hope someone can help with this issue. -Also I'm open to hearing any other suggestions on how to do this display this information on our homepage. Thank you!!


I have deployed a few test clients using WES 7 RC. In Image Configuration Editor I have included and configured FBWF for use with the installation, including setting the C: volume to be protected and three different paths to be exluded from the write filter. I also configured the write filter not to be enabled by the unattended installation since I wanted to enable it manually during a later stage of the deployment phase.

However, when checking the configuration of FBWF using fbwfmgr.exe, none of the configuration that I entered in ICE is present on the installed system. I have to enable the write filter to configure it and then add the C: volume and set the write-through exclusions that I previously configured using ICE.


Is this by design? Must FBWF be automatically enabled at deployment by IBW in order for the configuration options set in the unattended XML file to take effect?

Where does the FBWF component store its settings on the system? I couldn't find anything in the registry with a quick search.



I’ve customized the case entity so I add a contact lookup field to the form, now I have the account lookup field under it I have the contact lookup field,

Is there any way to filter the contact lookup based on the selection from the account lookup?




Hello guys!

Im in trouble when trying to use a MDX Filter to filter an excel report.


I created an excel report and in the pivot table I added a filter based on one Attribute, and set that to me a parameter. I published it at the site document library.
Now with sharepoint designer i create an MDX filter that uses an SSAS Assembly that i created to return the Member Key Set(EX: [Seller].[ID].&[5]). The filter do work right alone, like when i create one dashboard and add two web parts, one for the mdx filter and other to the report. Both of them works nice alone but the excel parameter field dont get the value of the filter.

Example of dashboard:

| ID <5>(here it shows the value requested by the mdx)   | Filter Web Part
|  ID  | All  |                                                                  |
|Brazil |10
|USA   |5                                                                     |The report works fine
|                                                                                  | too, but as you can
|=========================================| see the ID is not 5
so the value is still as I defined in the report and didnt get the MDX Filter return value.

When i try to dropdown the ID in the report it says that :

"The data connection uses Windows Authentication and it was not possible to delegate user credentials".

Do you guys know if it is possible?

My main goal is to filter the report based on the current logged FBA (SQLmembership) user. So until now i created a table to link the FBA user to the current member that will be the filter. But i cant get excel services work with the mdx query returned member.



Hi all,

I'm currently trying to figure out the best way to notify a datagrid of changes to items within a collection, when a filter has been set. It is important to note that the items in the collection are updated from external sources (via WPF's dispatcher), rather than directly from user input.

I'm more than happy to post my code, but before that, maybe there is a well known practice for re-applying filters that I just haven't found yet?

As background, the datagrid that I am using is bound to a property of the code-behind class. That property is of type ICollectionView, and happens to be an observable collection. The observable collection contains items of a type which implement INotifyPropertyChanged. The collection view also has a filter, which I set during initialisation.

When the datagrid is rendered (on form load), the datagrid's contents look correct. Only the filtered data is present, which is what I would expect. Also, when the collection changes (i.e. an add or delete takes place), the datagrid is updated, and the filter is applied correctly. So far, so good!

When an item within the collection itself changes (i.e. a notifiable property is set), the datagrid reacts by updating that item in the current view. However, the filter is not being (re)applied.... therefore if the item now doesn't match the existing filter, it will still be displayed.

I would have expected the filter to be applied whenever a property in the observable collection changes, not just when the collection itself changes. My expectations have been set by the fact that the datagrid can observe notifiable properties... I would have thought that the grid would have been smart enough to reapply the filter (it seems like the most common use case to me).

I've tried many different approaches to solving this problem, including:

Using dependency properties to notify the code-behind when a item in the observable collection changes Attempting to handle the TargetUpdated event of the data grid

The best approach (so far) is to actually replace the edited item in the collection (with itself) whenever the item is edited. This makes the observable collection fire a collection changed event, which I happily handle in the code-behind, and then ask the ICollectionView to update (which reapplies the current filter). However, it seems very inefficient to have to do this, particularly considering the fact that the datagrid itself seems to already know about the changes of individual INotifyPropertyChanged items in the observable collection.


Many thanks,



Hi all, I'm new here and my experience with Sharepoint 2010 is limited so go easy on me :)

I have created a basic document library and added "modfied" as a key filter for metadata navigation.  When I enter a date the filtered results are out by one day, I actually have to enter the next day in the filter to find the correct items I want. 

For each item the Modified column is showing the correct timestamp for the date/time it was modified, so why isn't it returing the correct items when I try to use the Key Filter?  I have my Regional Settings for the site set to Australia and UTC +10.

Is there something I'm completely missing?  Anyone else having this issue or can replicate the problem for me?


Hello,Is it possible to build a filter in Project Pro 2007 and in a task PWA view:

Filter which will test if the task Finish date is less than the Current Date.

I believed that the Now() function was operational, but it seems that it is not.

Any ideas ?


My Data was created by retrieving ODBC data - using PowerPivot for Excel 2010, and has Birthdate defined as a Data Type = "Date".  This was uploaded to SharePoint, and a New Dataset was created to point at it.

I'm using Microsoft SQL Server 2008 R2 Report Builder 3.0.  I tried to filter this data on Birthdate, but when I go into the Filter, and specify the field that was defined as DataType = "Date" in PowerPivot - Report Builder changes the type to "Text", and gray's out the field so that I can't change it to "Date".

If I create an Expression as Cdate(Birthdate.Value), it lets me change the Data Type to "Date", and works appropriately, but we don't want to have to do this with every date field.

Why doesn't Report Builder see this field as a Date ? 

I am using the IFileDialog interface and I want to get the file filter selected when changing the file filter combo.  I want to do this from OnTypeChange event handler.  I know I can use GetFileTypeIndex to get the index of the selection, but I want to get the actual text so that I can extract the new extension and update it to my filename selected.  Can this be done?

Hi - I am unable to filter a Documents list, in my team site, by date.

I have a bunch of folders and files from the last few years in there and I would like to hide everything EXCEPT ones within the last 60 days.

I would prefer this to be filtered by the [Modified] column that is displayed in my list view, however when I go to filter that column is not listed as an option. Neither is [Created On].

Any suggestions?
I've already tried making a calculated column with the Today trick, but that kept popping errors and also is static, so less than ideal.



when a phone call activity is created from the lead entity

Workflow as to check the due date attribute for the phone cal activity (which is created from the lead entity) if the due date is less than 1 day from the current date

its as to create a task for a phone cal activity owner

How can i achieve this task

Reply as soon as possible





I need to update all the rows in a table with a date that increments by two months each time.

I.e.  Row1 should have a date of 1/3/2010,  Row2 = 1/5/2010, Row3 1/7/2010 

The tricky bit is that the user needs to be able to enter the row number, so that it can start on any row and the start date.

e.g. Input 7 and 1/9/2010 and the query update all rows from 7 onwards with date 1/9/2010 incrementing each time, so row8 is 1/11/2010 etc.

I know how to add months to a date, but I can't work out how to make the query work on the previous record.


Please help!!!



We are currently using Team Foundation Server as our source control solution for a pilot project.

When a user right clicks on a file in 'Source Control Browser' in Visual Studio 2005 and selects 'Get Latest Version,' he/she gets the file without any problem. However, the 'Date Modified' and 'Date Created' attributes of the local file are set to the time he/she got the file from the source control. It is important for us that we get the files with the exact date attributes that they were checked in with.

Use-case senario:

-User A modifies a file on June 20th and checks it in.

-User B gets the latest version of the file on June 21th.

-The file on B's machine states that the file was last modified on June 21th and thus fails our entire Test Procedure.

Any ideas on how this can be corrected?


I'm developing a wpf windows app ( my first one ) and I can't manage to solve this problem I have.

Take two  comboboxes, each with the selectedValue bound to a path in the window's DataContext. The DataContext is set to a table in a DataSet.

SelectedValue="{Binding Path=brandID}"
SelectedValue="{Binding Path=modelID}"
And on the window loaded event I setup the ItemsSource for them:
privatevoid Window_Loaded(object sender, RoutedEventArgs e) 
this.DataContext = this.ProductsDataSet.products; 
// Lookup values from all brands
this.ddlBrand.ItemsSource = this.ProductsDataSet.brands;  
// Lookup values from all models
this.ddlModel.ItemsSource = this.ProductsDataSet.models;  
// setting up the CollectionView
this.view = (CollectionView)CollectionViewSource.GetDefaultView(this.ProductsDataSet.products);        

What I need is when I select a value from ddlBrand, the values in ddlModel to be limited to the ones available to the specific brand selected. In the same time, the SelectedValue for the models ( which is of type int) is to be set to the value in the products table.
I've tried to implement this in several ways ( setting up the ItemsSource ddlModel on the SelectionChanged event of ddlBrand, setup a CustomFilter for the BindingListCollectionView of ddlModel - in the same event, the previous 2 versions in different events and variations etc. ) no success. Everytime I modify the source or the view of ddlModel the SelectedValue binding setup in XAML is lost ( I've tried rebinding in code) . Everytime I change the product I'm viewing the selection in ddlModel is lost.
I believe this is a simple common task, so there must be something I'm missing.  It's been almost 2 days since I'm strugling with this ( productive, huh? ). Can someone share some knowledge?

PS: The data is taken from an access database. DataSet created with drag and drop in the designer. Tables: products(productID, brandID, modelID, version, etc), brands (brandID, brandName), models (modelID, modelName ) . The navigation is like in How Do I: Create a Simple Data Entry Form in WPF



could some one tell me why when I filter on date 'Sep 19' is working but not on 'Sep 09' ?

I have both in my database dates on Sep 09 and 19.

it seems that above the 10th date it's not working

Do you have any idee how I can solved this issue ?

Here the query that I use: (date comes from a datagrid in my application that is formated as 'MMM dd yyyy')

SELECt v.RequestDate 
FROM vv_Job as v
WHERE(v.RequestDate LIKE '%Sep 09%')



<< Previous      Next >>

Microsoft   |   Windows   |   Visual Studio   |   Sharepoint   |   Azure