views:

6011

answers:

1

Hi,

I have two columns C1 and C2, both of type date and time in a document library. Now i want to create a calculated column C3 using which i could know which column(C1 or C2) is having greater value. I tried following formula for calculated column IF(C1>C2, 1,0) it works perfectly fine, but if i replace C1 with 'Modified' column it doesnt seem to work. Please use different datetime values for C2 to get 1,0,1,0 in calculated column. I noticed that after 2-3 operations it remains either 1 or 0.

A: 

Update I've just tested this as follows:

Create List with 3 columns:

C1 - Date and Time    
C2 - Date and Time    
C3 - Calculated Column.

I configured the Calculated Column to return a Number and entered the following formula in:

=IF(c1>c2,1,0)

This worked perfectly.

If the Calculated Column should return Text (the default setting) then using the following formula worked:

=IF(c1>c2,"1","0")

Once again, this works perfectly for me.

Temple
I have tested with square bracket but square brackets doesnt matter.
Anoop
I've updated my answer having been able to test the solution
Temple
HiI am using 'Modified' column in place of column C1 in your example.In that case above formula doesnt work. I have also checked that if both column c1 and c2 are custom column, formula works perfecly. Is 'Modified' column is not of type 'Date and Time'? Can you please confirm the behaviour using 'Modified' column in place of C1(Please check for at least 3 differnt datetime values to reproduce the problem).
Anoop
Hi, I've tried this and the following formula works for me:=IF(Modified > c2,1,0)I've tried this with several different values. Can you explain what you mean by "Please check for at least 3 different datetime values to reproduce the problem"?
Temple
I dont know why am i getting this problem!!! The problem is only with Modified column. Its like Modified column value is 5/18/2009 9:00 AM and c2 column value is 5/17/2009 10:00 AM but calculated column c3 shows 0. Now if i change c2 to 5/19/2009 10:00 AM , still c3 shows 0.Do you have installed any service pack of Sharepoint services 2007?? I have not installed any service pack? please confirm ASAP.
Anoop