where clause not working with AND operator

Mohammad Qasim 576 Reputation points
2021-03-15T18:26:40.62+00:00

Hi,

fetching data from Sharepoint online , to shoe data on asp.net page.

Problem : Where clause not working with And operator to fetch records , based on date.

Solution Required: I need to know , how or what to write in query to fetch data accordingly.
attached image is added for reference.
77884-expirydatewherecluase.png

Thanks

Microsoft 365 and Office | SharePoint Server | Development
0 comments No comments
{count} votes

Answer accepted by question author
  1. MichaelHan-MSFT 18,136 Reputation points
    2021-03-16T03:01:10.51+00:00

    Hi @Mohammad Qasim ,

    The DateTime in SharePoint needs to be in specific format : yyyy-MM-ddTHH:mm:ssZ. The variable dtexppiry should be configured like the below:

    string dtexppiry=DateTime.Today.ToString("yyyy-MM-ddTHH:mm:ssZ");   
    

    If an Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.