Date to sum
how to sum date in sql 2005..i jest selected from date and to date from date time picker
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Sunny SharmaRank #223 · 11.1K reputationPosted Sep 3, 2013, 3:32 AM EDT
Please explain how you want the Date to be summed up? Any Sample demo would be great.
SUNIL GUTTARank #1,832 · 810 reputationPosted Sep 3, 2013, 10:30 AM EDT
Hemant SrivastavaRank #581 · 4.2K reputationPosted Sep 3, 2013, 1:11 PM EDT
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());
}