KQL | "today" function giving strange result | Need more clarification

%3CLINGO-SUB%20id%3D%22lingo-sub-3177123%22%20slang%3D%22en-US%22%3EKQL%20%7C%20%22today%22%20function%20giving%20strange%20result%20%7C%20Need%20more%20clarification%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3177123%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20one%20property%20of%20datetime%20(Deadline%20Date)%20and%20wanted%20use%20that%20in%20filtering%20data%20in%20KQL.%20Result%20set%20which%20I%20want%20from%20KQL%20is%20that%20Articles%20(Site%20Pages)%20should%20get%20whose%20Deadline%20date%20(mapped%20to%20RefinableDate02)%20is%20greater%20than%20or%20equal%20to%20current%20date%20and%20time.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ECurrently%20query%20has%20been%20written%20like%20below%20screenshot.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22pratikdarak21_0-1645082385667.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F348958iC458DA123816BA44%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22pratikdarak21_0-1645082385667.png%22%20alt%3D%22pratikdarak21_0-1645082385667.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%202%20site%20pages%20whose%20values%20mapped%20like%20below.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22pratikdarak21_1-1645082648965.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F348960i0658BF87E10B1136%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22pratikdarak21_1-1645082648965.png%22%20alt%3D%22pratikdarak21_1-1645082648965.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E*********Result%20Set%20from%20KQL%20**********%3C%2FP%3E%3CP%3EExample%201%3A%20No%20output%2Fresult%20if%20timestamp%20have%2000%3A00%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EExample%202%3A%20Getting%20output%2Fresult%20if%20timestamp%20have%2000%3A01%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAs%20mentioned%20in%20Microsoft%20doc%20(%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fsharepoint%2Fdev%2Fgeneral-development%2Fkeyword-query-language-kql-syntax-reference%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%22%3ELink%3C%2FA%3E)%2C%20%22today%22%20r%3CSPAN%3Eepresents%20the%20time%20from%20the%20beginning%20of%20the%20current%20day%20until%20the%20end%20of%20the%20current%20day.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3ESo%20considering%20above%20description%2C%20example%201%20should%20also%20work%20fine.%20But%2C%20it%20doesn't.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EAny%20documentation%2Fguidance%20would%20be%20very%20helpful%20to%20understand%20how%20%22today%22%20returns%20value%20and%20getting%20compared%20in%20KQL%20query%20for%20results.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EThanks%20in%20advance%20!%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3ERegards%2C%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EPratik%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-3177123%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ESharePoint%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Occasional Contributor

Hi,

 

I have one property of datetime (Deadline Date) and wanted use that in filtering data in KQL. Result set which I want from KQL is that Articles (Site Pages) should get whose Deadline date (mapped to RefinableDate02) is greater than or equal to current date and time.

 

Currently query has been written like below screenshot.

 

pratikdarak21_0-1645082385667.png

 

I have 2 site pages whose values mapped like below.

pratikdarak21_1-1645082648965.png

*********Result Set from KQL **********

Example 1: No output/result if timestamp have 00:00

 

Example 2: Getting output/result if timestamp have 00:01

 

As mentioned in Microsoft doc (Link), "today" represents the time from the beginning of the current day until the end of the current day.

 

So considering above description, example 1 should also work fine. But, it doesn't.

 

Any documentation/guidance would be very helpful to understand how "today" returns value and getting compared in KQL query for results.

 

Thanks in advance !

 

Regards,

Pratik

0 Replies