Customized SharePoint List Filtering Condition
Hi lincky, Based on your description, you cannot achieve this through out-of-the-box in filter, as parvez said, we can use custom data view web part through SharePoint Designer. When you insert a data view, right click the view, click filter to edit the filter formula. Here is expression of filter based on Created column(to check whether time is between 6am and 5pm, we use 24hour format to compare): [number(substring((ddwrt:FormatDateTime(string(@Created),1033,'H:mm')),1,3))>=6 and number(substring((ddwrt:FormatDateTime(string(@Created),1033,'H:mm')),1,3))<=17] Please check it , if there is any problem, please feel free to let me know. Best Regards.Qiao Wei TechNet Community Support
June 19th, 2012 11:18pm

Hi, I would like to set a filtering condition within the fixed variable date under SharePoint TeamSite List view. How could I achieve it? As far as the condition is allowed like [Today] or [Me], my request is to filter those filtered list from 6AM to 5PM GMT+8 everyday according to the creation date.
Free Windows Admin Tool Kit Click here and download it now
June 20th, 2012 1:30pm

By default, SharePoint filters only by Date. You'll need SharePoint designer and either edit that existing view or create a DVWP of that list with appropriate filter. Whichever option you choose, you'll need to add the following "attribute" to the CAML query for the DateTime field being filtered. IncludeTimeValue=True This will allow you to get the filter to include, well... time. As for the GMT+8, I *think* that'll depend on whatever is the regional setting of the site is, that's what will be used in the all DateTime stamp for the records. I had done this before, but don't remember exactly what value of the condition looks like. If you play around it, you might be able to figure it out. Shouldn't be too difficult. Hope that helps... Pman http://www.pmansLab.com/
June 20th, 2012 10:30pm

Hi lincky, Based on your description, you cannot achieve this through out-of-the-box in filter, as parvez said, we can use custom data view web part through SharePoint Designer. When you insert a data view, right click the view, click filter to edit the filter formula. Here is expression of filter based on Created column(to check whether time is between 6am and 5pm, we use 24hour format to compare): [number(substring((ddwrt:FormatDateTime(string(@Created),1033,'H:mm')),1,3))>=6 and number(substring((ddwrt:FormatDateTime(string(@Created),1033,'H:mm')),1,3))<=17] Please check it , if there is any problem, please feel free to let me know. Best Regards.Qiao Wei TechNet Community Support
Free Windows Admin Tool Kit Click here and download it now
June 20th, 2012 11:38pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics