I am using SQL 2005. When i am selecting a set rows from the table with the appropriate where condition, it return value as 31. The same select value if i update to another table it is updating as 30. i used the SQL update as follows
update tablename
set column1 = (Select column2 from tablename where month(field1) = 05 and year(field1) =2010)
where field 2 = 'xxx'
If i execute the inner select alone, it returns a value in column2 as 31. Once the update executed and select from the updated table, it shows as 30.
Only 1 number difference for many rows...
Could anybody face this problem...