Joined: 13 Sep 2010
Location: United States
Online Status: Offline
Posts: 45
Topic: String to time Posted: 20 Dec 2010 at 4:48am
I've got a field that is a string and appears like, "XXX:XX:XX." This is the format I like, but it won't work when I try to summarize multiple fields in the report footer (because it's a string and not a time). To get it into the time format, I've tried CTime({FieldString}) and it returns with an error saying "Bad Format Time String." Can someone provide me with some much-needed insight here?
Joined: 13 Sep 2010
Location: United States
Online Status: Offline
Posts: 45
Posted: 20 Dec 2010 at 5:00am
Here's what I'm working with:
12:45:22 (string)
102:45:45 (string)
42:23:00 (string)
I want to somehow summarize these to get a field I will put into the report footer to return: "157:54:07."
The problem is that I can't summarize the strings because they're non-numerical. I thought a possible solution would be to convert the strings into time fields, so that I could then summarize the time fields. When I tried to convert the string field to a time field, it returned the error (described above).
Can you help me figure out how to convert the string to a time field that I can then summarize?
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Posted: 20 Dec 2010 at 5:04am
so you want a total amount of time from all of them?
YOu would have to convert the strings (time) into a number that is the lowest time value you want to look at (minutes or second as I do not know ehich I am looking at in your sample)
Then add these values togther at a group of report footer level.
Then convert that back into whatever dispaly string you want.
Note you are getting the bad format as some of those strings are non existent time values
Joined: 13 Sep 2010
Location: United States
Online Status: Offline
Posts: 45
Posted: 20 Dec 2010 at 5:57am
I think I follow your logic, but I don't follow the instructions. How would I "convert the strings into a number that is the lowest time value" (this is seconds for me)?
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum