i have a table with content. The table structure is below. I want to update the table with some condition. I will try to update this but i can't am new for MySQL please help me..
My table structure :
Emp_id Emp_Name Join_date confirm_date resign_date status con_status
001 arun 2011-01-12 2012-06-12 A confirmed
002 aruna 2011-02-12 2012-11-12 2012-04-10 D Not-confirmed
002 aruna 2011-06-12 2012-12-12 A Not-confirmed
004 vinos 2011-03-12 2012-10-01 A //null value
I want to update the con_status like this when the date
Emp_id Emp_Name Join_date confirm_date resign_date status con_status
001 arun 2011-01-12 2012-06-12 A confirmed
002 aruna 2011-02-12 2012-11-12 2012-04-10 D Not-confirmed
002 aruna 2011-06-12 2012-12-12 A Not-confirmed
004 vinos 2011-03-12 2012-10-01 A confirmed
My condition like this.
if(con_status == null)
{
if(confirm_date > Datetime.Now)and (status='Active')
{
//update con_status as confirmed
}
}
else if(con_status == Not-confirmed)
{
if(confirm_date > Datetime.Now)and (status='Active')
{
//update con_status as confirmed
}
else
{
maintain the previous status
}
}