date to sum
how to sum date in sql 2005..i jest selected from date and to date from date time picker
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Hemant SrivastavaPosted Sep 3, 2013, 5:11 PM
DateTime dtFrom;
DateTime dtTo;
private void dateTimePicker1_ValueChanged(object sender, EventArgs e)
{
dtFrom = dateTimePicker_From.Value;
}
private void dateTimePicker_To_ValueChanged(object sender, EventArgs e)
{
dtTo = dateTimePicker_To.Value;
}
private void btn_CalcDays_Click(object sender, EventArgs e)
{
TimeSpan timespan = new TimeSpan();
timespan = dtTo - dtFrom ;
MessageBox.Show(Math.Abs(timespan.Days).ToString());
}
SUNIL GUTTAPosted Sep 3, 2013, 2:30 PM
Sunny SharmaPosted Sep 3, 2013, 7:32 AM
Please explain how you want the Date to be summed up? Any Sample demo would be great.