SharePoint Date/Time Filter

%3CLINGO-SUB%20id%3D%22lingo-sub-1260340%22%20slang%3D%22en-US%22%3ESharePoint%20Date%2FTime%20Filter%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1260340%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSPAN%3EI%20have%20a%20SharePoint%20list%20with%20a%20large%20number%20of%20entries.%26nbsp%3B%20There%20is%20a%20Date%2FTime%20column%20in%20the%20following%20format%3A%20mm%2Fdd%2Fyyyy%20hh%3Amm.%26nbsp%3B%20I%20have%20need%20to%20filter%20the%20data%20between%20yesterday%20at%2014%3A00%20and%20today%20at%2013%3A59.%26nbsp%3B%20I've%20search%20high%20and%20low%20but%20have%20not%20been%20able%20to%20find%20a%20solution.%26nbsp%3B%20Ideas%3F%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EThanks!%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1260340%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3Efilters%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%20Online%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1260588%22%20slang%3D%22en-US%22%3ERe%3A%20SharePoint%20Date%2FTime%20Filter%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1260588%22%20slang%3D%22en-US%22%3EHi%2C%3CBR%20%2F%3EIf%20you%20want%20to%20do%20it%20within%20the%20list%2C%20then%20try%20creating%20a%20computed%20column%20and%20make%20sure%20your%20condition%20of%20datetime%20is%20applied%20which%20will%20be%20true%20or%20false.%20Then%20you%20can%20try%20filtering%20the%20computed%20columns%20for%20values%20with%20true.%20Try%20using%20column%20formatting%20and%20apply%20the%20condition%20in%20the%20new%20column%20using%20column%20formatting.%20Please%20refer%20the%20below%20link%20for%20some%20samples%20using%20column%20formatting.%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FSharePoint%2Fsp-dev-list-formatting%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2FSharePoint%2Fsp-dev-list-formatting%3C%2FA%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1260614%22%20slang%3D%22en-US%22%3ERe%3A%20SharePoint%20Date%2FTime%20Filter%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1260614%22%20slang%3D%22en-US%22%3EHi%2C%3CBR%20%2F%3ELet's%20say%20the%20Date%2FTime%20column%20you%20have%20is%20ServiceDate%2C%20you%20could%20add%20a%20new%20calculated%20column%20to%20extract%20and%20store%20the%20time%20(use%20the%20below%20formula%20to%20get%20the%20time%20component%20and%20save%20it).%20Now%2C%20you%20can%20either%20filter%20directly%20with%20these%202%20date%20and%20time%20columns%20or%20create%20a%20view%20and%20configure%20filter%20to%20show%20the%20items%20filtered%20using%20these%202%20columns%20for%20the%20required%20range.%3CBR%20%2F%3EFormula%20for%20the%20calculated%20column%20-%3CBR%20%2F%3ETEXT(ServiceDate-DATE(YEAR(ServiceDate)%2CMONTH(ServiceDate)%2CDAY(ServiceDate))%2C%22h%3Amm%22)%3CBR%20%2F%3E%3CBR%20%2F%3EThanks.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1261281%22%20slang%3D%22en-US%22%3ERe%3A%20SharePoint%20Date%2FTime%20Filter%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1261281%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F114813%22%20target%3D%22_blank%22%3E%40Swaminathan%20Sriram%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%20for%20the%20response.%26nbsp%3B%20I%20have%20a%20time%20column%20now.%26nbsp%3B%20How%20would%20the%20filter%20look%20in%20the%20SP%20view%3F%20Seams%20I%20would%20need%20to%20use%20the%20%5BToday%5D%20function%20somehow%20to%20get%20yesterday's%20entries%20after%2014%3A00%20and%20then%20today's%20entries%20before%2013%3A59.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks!%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Contributor

I have a SharePoint list with a large number of entries.  There is a Date/Time column in the following format: mm/dd/yyyy hh:mm.  I have need to filter the data between yesterday at 14:00 and today at 13:59.  I've search high and low but have not been able to find a solution.  Ideas?

 

Thanks!

3 Replies
Highlighted
Hi,
If you want to do it within the list, then try creating a computed column and make sure your condition of datetime is applied which will be true or false. Then you can try filtering the computed columns for values with true. Try using column formatting and apply the condition in the new column using column formatting. Please refer the below link for some samples using column formatting.
https://github.com/SharePoint/sp-dev-list-formatting
Highlighted
Hi,
Let's say the Date/Time column you have is ServiceDate, you could add a new calculated column to extract and store the time (use the below formula to get the time component and save it). Now, you can either filter directly with these 2 date and time columns or create a view and configure filter to show the items filtered using these 2 columns for the required range.
Formula for the calculated column -
TEXT(ServiceDate-DATE(YEAR(ServiceDate),MONTH(ServiceDate),DAY(ServiceDate)),"h:mm")

Thanks.
Highlighted

@Swaminathan Sriram 

 

Hi,

 

Thanks for the response.  I have a time column now.  How would the filter look in the SP view? Seams I would need to use the [Today] function somehow to get yesterday's entries after 14:00 and then today's entries before 13:59.

 

Thanks!