Dec 2, 2003 #1 JVZ Programmer Sep 3, 2002 205 CA Hello all, I need help writing a query that will sum the Minutes. For format of the time field is: MMMMSST (the field will always contain 7 characters). Where M = min, S = Sec, and T = tenth of a sec. Any suggestion? Thanks
Hello all, I need help writing a query that will sum the Minutes. For format of the time field is: MMMMSST (the field will always contain 7 characters). Where M = min, S = Sec, and T = tenth of a sec. Any suggestion? Thanks
Dec 2, 2003 #2 JohnDTampaBay Programmer Jul 12, 2002 986 US Is this what you're looking for? SELECT Sum(Left(TimeField,4)) FROM TimeTable --Angel ----------------------------------- Every time I lose my mind, I wonder if it's really worth finding. Upvote 0 Downvote
Is this what you're looking for? SELECT Sum(Left(TimeField,4)) FROM TimeTable --Angel ----------------------------------- Every time I lose my mind, I wonder if it's really worth finding.
Dec 2, 2003 Thread starter #3 JVZ Programmer Sep 3, 2002 205 CA Thanks for the reply. That is sort of what I'm looking for, however I need to also account for the seconds when summing. Upvote 0 Downvote
Thanks for the reply. That is sort of what I'm looking for, however I need to also account for the seconds when summing.
Dec 3, 2003 #4 jby1 Programmer Apr 29, 2003 403 GB Try this ... Code: SELECT Sum(convert(int,Left(TimeField,4))) + (Sum(convert(int,(Substring(Timefield, 5, 2)))) / 60) + (Sum(convert(int,(Right(TimeField, 1)))) / 600) FROM TimeTable Upvote 0 Downvote
Try this ... Code: SELECT Sum(convert(int,Left(TimeField,4))) + (Sum(convert(int,(Substring(Timefield, 5, 2)))) / 60) + (Sum(convert(int,(Right(TimeField, 1)))) / 600) FROM TimeTable