>I'm attempting to determine the elapsed time (in total minutes) between two datetime values in VB.Net (2005).
>
>In the web application, a student will "log in" which stores DateTime.Now to a datetime SQL Server 2000 field (STARTTIME).
>
>Later (could be a few minutes, hours, or even days), the student will complete what they are working on and will "log out" of the web application, so the app stores DateTime.Now to another datetime SQL Server field (STOPTIME).
>
>At this point, (in VB.Net, not in SQL) I'd like to determine just the number of minutes that have elapsed. In other words, the difference between STARTTIME and STOPTIME, expressed in minutes.
>
>I've been playing around with TimeSpan and AddMinutes, etc, but I'm not having much luck. Any suggestions are appreciated!
>
>Thanks,
Just wanted to post an update.... lol
Turns out one of the custom data classes I was using had code in the class that was Date (and not DateTime), therefore loading values from the database were being truncated to date only (dropping the time portion). That would certainly explain why my "total minutes elapsed" was not calculating properly!
All is well!
Thanks,