Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8007301
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T17:46:48+00:00 2026-06-04T17:46:48+00:00

WCF Data Services conveniently allow querying and filtering data via options in the URL.

  • 0

WCF Data Services conveniently allow querying and filtering data via options in the URL. For example, say I want Products with a price greater than 20:

http://www.example.com/Service.svc/Products?$filter=Price gt 20

But how do I use the $filter option with a DateTime? Say I want all Products that have been modified this month.

http://www.example.com/Service.svc/Products?$filter=ModifiedDate gt ‘2012-05-02’

This doesn’t work for me; it gives the error message

Operator ‘gt’ incompatible with operand types ‘System.DateTime’ and ‘System.String’ at position 13.

I get the same with other comparison operators (ge, lt, le, eq). What is going on? How do I make this work? Do I need a certain DateTime format? What I tried above seems to be documented here.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T17:46:49+00:00Added an answer on June 4, 2026 at 5:46 pm

    Hi try using the following syntax

    $filter=ModifiedDate gt datetime'2012-05-02T00:00:00'
    

    The other date time functions can be found in this reference for odata url conventions

    URI conventions :

    • prior to 5.0 (OData v2)
    • for 5.0 (OData v3)

    http://msdn.microsoft.com/en-us/library/dd728283.aspx

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to expose legacy .net code via WCF Data Services. But without using
Using WCF Data Services (and the latest Entity Framework), I want to return data
I have a simple WCF Data Services service and I want to expose a
I want to use Services(WCF/RIA /Web) to take data from Entity Data Model class
LinqPad supports WCF Data Services. If you assign an URL, such as http://services.odata.org/Northwind/Northwind.svc/ .
I'm trying to expose a model class via WCF Data Services that has an
We are exposing a domain model via WCF Data Services. The model originates from
We have a Silverlight application that uses WCF Data Services. We want to add
I've been checking out WCF Data Services today and it looks great - but
I'm getting started with Astoria/ADO.NET Data Services/WCF Data Services. Looking through a lot of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.