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

Say, I have a SourceList with date fields like these DateReceived, DateEntered. If these field or fields are null then in workflow updates the target list item with 1/1/1900 dates respectively.

What's the fix for this?

share|improve this question

Actually, 1/1/1900 is SQL Server's default value for datetime. For overcome this problem, you can check the value and if it is empty use SqlDateTime.Null instead of null.

if (!string.IsNullOrEmpty(dateVar))
   cmd.Parameters.AddWithValue("@Date", dateVar);
   cmd.Parameters.AddWithValue("@Date", SqlDateTime.Null);
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.