SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to get the filtered results by a column type DateTime from a list filled with BCS using JavaScript.
I've tried everything to get those results with query like:

"<Where>" +
    "<Geq>" +
        "<FieldRef Name='Fecha'/>" +
            "<Value IncludeTimeValue='FALSE' Type='DateTime'>" +
                "3/12/2013" +
            "</Value>" +
    "</Geq>" +
"</Where>" +

also removing the IncludeTimeValue='FALSE'.
Does someone know the correct syntax for this query?
Or is it a known issue?

share|improve this question

Your datetime has to be converted into ISO8601 format. See another question about it (but in server side).

So, your date has to have the format: 2013-03-12T00:00:00.000Z

In javascript you can do this:

var date = new Date(2013, 3 - 1, 12); //months are zero based
var iso = date.toISOString();

then iso string can be in the caml query.

I would also recommend the MIT licenced momentjs for parsing, processing, comparing and formating dates in javascript, and Ms-PL licensed camljs for creating complex (and simple of course) caml queries.

share|improve this answer
I've already tried the ISO format, but it just doesn't filter them. Those JavaScripts might be useful, i will try them. Thanks for the help. – lostuser23 Mar 26 '13 at 20:04

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.