Marvin kakuru

Marvin kakuru

  • 1.1k
  • 355
  • 160.1k

Difference DateValues

Jul 13 2012 8:26 AM
 

Hi there,

I hope your all alright. Im trying to get the difference between date values in two textboxs, textbox1.text and textbox2.text and the difference being the number of days in between the two date values to be viewed in textbox3.text.

Below is the code I attempted to use but I am getting errors

 {

            decimal a = System.Convert.ToDateTime(textBox16.Text);

            decimal b = System.Convert.ToDateTime(textBox17.Text);

            decimal c = (b - a);

            textBox18.Text = c.ToString();

 

 }

 

Any help will be greatly appreciated.

Thanks and Best Regards to Everyone.


Answers (2)