I have got a two CAML Queries. How Could i set them to see all object on ASP Calendar 3 months from today day? Here are the Queries:

 string DateOnlyQuery = "<Where><Eq><FieldRef Name='{0}' /><Value Type='DateTime'>{1}</Value></Eq></Where>";
        string FullQuery = "<Where><And><Eq><FieldRef Name='{0}' /><Value Type='DateTime'>{1}</Value></Eq><Eq><FieldRef Name='Pracownik' /><Value Type='Text'>{2}</Value></Eq></And></Where>";

I want only Visible days

3 month from today > Dates on Calendar < Today date


I think you need this -

     <FieldRef Name="Created" />
     <Value Type="DateTime">[Today-3Month(s)]</Value>

BTW why dont use some CAML query builder like U2U or any other tool, your task will be a lot easier if you use CAML query heavily

  • I Use but i don't cnow how to corelate all the Queries. Your Query and mine Query. With AND ? Sorry that I'm assking, but I'm beginer of CAML – Grzegorz Z Nov 29 '12 at 10:13
  • 1
    That's why I asked you to use U2U, query construct should be - <Where><And><Geq> <FieldRef Name="Created" /> <Value Type="DateTime">[Today-3Month(s)]</Value> </Geq>Your query part</And></Where> if you have more than one and condition the it should be <Where><And><And><Geq> <FieldRef Name="Created" /> <Value Type="DateTime">[Today-3Month(s)]</Value> </Geq>Your first query</And>Your second query</And></Where> and so on, use CAML query builder things will be easier – Diptarag Nov 29 '12 at 10:22
  • I Use this Query and show me nothing: string DateOnlyQuery = "<Where><And><Eq><FieldRef Name='{0}' /><Value Type='DateTime'>{1}</Value></Eq><Geq><FieldRef Name='{0}' /><Value Type='DateTime'>[Today-8Day(s)]</Value></Geq></And></Where>"; – Grzegorz Z Nov 29 '12 at 10:29
  • 1
    what is the value of {0} ? is it 'Created'? then what's the value of {1}? this query obviously wont work, one conflicts with another – Diptarag Nov 29 '12 at 10:40
  • 1
    What is Dzien ? it it some custom date time field? – Diptarag Nov 29 '12 at 10:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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