SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

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

Part of my timerjob does

DateTime week = DateTime.Now.AddDays(-7);
SPQuery mQuery = new SPQuery();
mQuery.Query = "<Where><Gt><FieldRef Name='myDay' /><Value Type='DateTime' IncludeTimeValue='False'>" + week.Date.ToString() + "</Value></Gt></Where>";


But it always has fieldref='created' and includetime=true no matter what I do.

Edit: I have also tried to change the query completely but anything I put just returns null

I thought maybe it was some sort of SharePoint cache issue but I have retracted, deleted, resetISS, & deployed to find no difference.

My Solution: I uninstalled the assembly from the GAC ( Drive\windows\assembly\ ) then I retracted my solution, resetiss, restart-service SPTimerV4, restarted the machine. Build & deploy. Things worked again

share|improve this question
up vote 0 down vote accepted

Seems like timer job is not getting deployed correctly,

Delete the custom timer job:
how to delete sharepoint timer job using powershell

Then deploy it again with your changes and see if that updates...

share|improve this answer
I have been using powershell to delete everything, although the feature event: onDeactivation only fires when disabled using the UI button. To remedy this I have been deleting each timer job via-powershell aswell as deactivating via-powershell – user13186 Dec 6 '12 at 23:21

One thing I've found with CAML (and this may or may not actually help you here) is that true != TRUE and false != FALSE. I've been burned by that before. Use all caps there.

Also, fieldRef should be FieldRef.

So the CAML to try would be:

"<Where>" +
  "<Gt>" +
    "<FieldRef Name='myDate'/>" +
    "<Value Type='DateTime' IncludeTimeValue='FALSE'>" + + "</Value>" +
  "</Gt>" +
share|improve this answer

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.