locked
compare date field in sharepoint designer without considering time

    Question

  • Hi

    I  set date1 field in sharepoint designer with “set field in current item” action. And in next step I want to compare date1 with another date field. With “if date1 not equal to date2”

    although I set  “Date & Time Format” to “Date only”, my problem is sharepoint designer consider time ( although my condition is true ,I think its compare the time of my date field and cant go next step) and I don’t want it. I want to compare date filed only with date,

    what should I do, that sharepoint designer only consider Date in Date field in action?

    Thanx a lot.

    Sunday, April 10, 2011 8:40 AM

Answers

  • when you compare two dates in SPD, click the condition "equal" a drop down will appear. Choose "equals (ignoring time)" as condition.

    It will appear  like:

    If  Created equals (ignoring time) ListName:Modifed

    That it.


    Dare to promise
    • Marked as answer by luckstar Tuesday, April 19, 2011 5:41 PM
    Monday, April 18, 2011 5:06 PM

All replies

  • Hi,

     

    I understand that you want to create a workflow which contains a condition to compare date1 to another data field. You need that SharePoint Designer only consider Date in Date field in action .You said that you have set  “Date & Time Format” to “Date only”. I want to know how did you accomplish this .

    I try to do as what you said and my workflow work properly .I just set the “Date & Time Format” to “Date only” by doing :Browse to a list or a document library and click Settings>List Settings /Document Library Settings .Click column date1 in the Column field to change “Date & Time Format” to “Date only” ,and then click OK. Change “Date & Time Format” to “Date only” of another date field according to the steps above . Then the workflow will only compare Date in Date field .

     

    Please let me know the results of these actions at your earliest convenience.

    Best Regards,

    Ming


    Ming
    Monday, April 18, 2011 8:06 AM
  • when you compare two dates in SPD, click the condition "equal" a drop down will appear. Choose "equals (ignoring time)" as condition.

    It will appear  like:

    If  Created equals (ignoring time) ListName:Modifed

    That it.


    Dare to promise
    • Marked as answer by luckstar Tuesday, April 19, 2011 5:41 PM
    Monday, April 18, 2011 5:06 PM
  • Ming-chch:

    I set the “Date & Time Format” to “Date only” through same way.

    (Settings>List Settings /Document Library Settings .Click column date1 in the Column field to change “Date & Time Format” to “Date only” ,and then click OK)

    But my problem solved when I used “equals (ignoring time)” Condition for comparing date.

    Thanx you and Deepak  for your answers.

    Tuesday, April 19, 2011 5:44 PM