• Upgrade your Internet Experience
  • Sign in
  • Microsoft.com
  • United States (English)
    Brasil (Português)Česká republika (Čeština)Deutschland (Deutsch)España (Español)France (Français)Italia (Italiano)Россия (Русский)대한민국 (한국어)中华人民共和国 (中文)台灣 (中文)日本 (日本語)香港特别行政區 (中文)
 
 
Microsoft Developer Network
 
 
Home
 
 
Library
 
 
Learn
 
 
Downloads
 
 
Support
 
 
Community
 
 
Forums
 
 
 
Microsoft Developer Network > SharePoint Products and Technologies Forums > SharePoint - Development and Programming > Sort DateTime Field
Ask a questionAsk a question
Search Forums:
  • Search SharePoint - Development and Programming Forum Search SharePoint - Development and Programming Forum
  • Search All SharePoint Products and Technologies Forums Search All SharePoint Products and Technologies Forums
  • Search All MSDN Forums Search All MSDN Forums
 

AnswerSort DateTime Field

  • Wednesday, March 26, 2008 10:07 AMNevrotik Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Vote As Helpful
    0
    Help me!
    I wish to take from the adjusted list the certain values on field DateTime.
    However, the inquiry sorts data only by date of, without consideration time. How it is possible to consider both date, and time?

    Code Snippet

    <Where>
     <Eq>
      <FieldRef Name='dateTimeField' />
      <Value Type='DateTime'>
       2008-03-24T12:00:00Z
      </Value>
     </Eq>
    </Were>


    Enter:
    1. 3/24/2008 12:00:00 AM
    2. 3/24/2008 5:00:00 PM
    3. 3/24/2008 12:00:00 AM
    • ReplyReply
    • QuoteQuote
     

Answers

  • Wednesday, March 26, 2008 10:10 AMGavin Morgan Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    Vote As Helpful
    0

    add in the IncludeTimeValue='TRUE'  property to the Value type. (like below)

     

    Code Snippet

    <Where>
     <Eq>
      <FieldRef Name='dateTimeField' />
      <Value Type='DateTime'  IncludeTimeValue='TRUE'>
       2008-03-24T12:00:00Z
      </Value>
     </Eq>
    </Where>

     

     

    • ReplyReply
    • QuoteQuote
     

All Replies

  • Wednesday, March 26, 2008 10:24 AMNevrotik Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Vote As Helpful
    0
    Thanks!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    • ReplyReply
    • QuoteQuote
     
  • Tuesday, August 05, 2008 3:01 PMLZandman Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Vote As Helpful
    0
    Thanks Gavin! If only I had known before... I've written a blog entry about this one:

    http://www.wirwar.com/blog/2008/07/30/sharepoint-frustrations-1-the-undocumented-includetimevalue-caml-attribute/
    • ReplyReply
    • QuoteQuote
     
Need Help with Forums? (FAQ)
 
© 2009 Microsoft Corporation. All rights reserved.
Terms of Use
|
Trademarks
|
Privacy Statement