PC Review


Reply
Thread Tools Rate Thread

Convert Text Value to Time

 
 
CompassDBA via AccessMonster.com
Guest
Posts: n/a
 
      26th Jan 2007
I imported a table that has fields that contain time in the format hh:mm:ss.
I need to calculate using the time and cannot do this because it is a text
field. When I try to convert it in the table to a date/time, the records are
deleted. I do not know how to really use VB, so if someone knows how to best
do this using a query then I would really appreciate any suggestion.

Thanks!

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200701/1

 
Reply With Quote
 
 
 
 
Roger Carlson
Guest
Posts: n/a
 
      26th Jan 2007
On my website (www.rogersaccesslibrary.com), is a small Access database
sample called "ConvertStringStuff.mdb" which illustrates how to do this
(among other things).

--
--Roger Carlson
MS Access MVP
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/...UBED1=ACCESS-L


"CompassDBA via AccessMonster.com" <u30801@uwe> wrote in message
news:6cde19a27032a@uwe...
>I imported a table that has fields that contain time in the format
>hh:mm:ss.
> I need to calculate using the time and cannot do this because it is a text
> field. When I try to convert it in the table to a date/time, the records
> are
> deleted. I do not know how to really use VB, so if someone knows how to
> best
> do this using a query then I would really appreciate any suggestion.
>
> Thanks!
>
> --
> Message posted via AccessMonster.com
> http://www.accessmonster.com/Uwe/For...ccess/200701/1
>



 
Reply With Quote
 
Douglas J. Steele
Guest
Posts: n/a
 
      26th Jan 2007
Try the CDate function.

Your best bet is to add a new field to the table and use the CDate function
to update that new field based on the text field. Once you've got all the
times proper, you can delete the text field.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"CompassDBA via AccessMonster.com" <u30801@uwe> wrote in message
news:6cde19a27032a@uwe...
>I imported a table that has fields that contain time in the format
>hh:mm:ss.
> I need to calculate using the time and cannot do this because it is a text
> field. When I try to convert it in the table to a date/time, the records
> are
> deleted. I do not know how to really use VB, so if someone knows how to
> best
> do this using a query then I would really appreciate any suggestion.
>
> Thanks!
>
> --
> Message posted via AccessMonster.com
> http://www.accessmonster.com/Uwe/For...ccess/200701/1
>



 
Reply With Quote
 
CompassDBA via AccessMonster.com
Guest
Posts: n/a
 
      29th Jan 2007
Roger Carlson wrote:
>On my website (www.rogersaccesslibrary.com), is a small Access database
>sample called "ConvertStringStuff.mdb" which illustrates how to do this
>(among other things).
>
>>I imported a table that has fields that contain time in the format
>>hh:mm:ss.

>[quoted text clipped - 6 lines]
>>
>> Thanks!



Roger - Thanks for the suggestion. You have a great site. The form that you
have the calculations done on is what I am looking for, but I need it in a
query. A query won't take the same formula that you are using. Do you have
any suggestions? Thanks!

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200701/1

 
Reply With Quote
 
Roger Carlson
Guest
Posts: n/a
 
      29th Jan 2007
Specifically which formula is not working in a query?

--
--Roger Carlson
MS Access MVP
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/...UBED1=ACCESS-L

"CompassDBA via AccessMonster.com" <u30801@uwe> wrote in message
news:6d0370ec2d35d@uwe...
> Roger Carlson wrote:
>>On my website (www.rogersaccesslibrary.com), is a small Access database
>>sample called "ConvertStringStuff.mdb" which illustrates how to do this
>>(among other things).
>>
>>>I imported a table that has fields that contain time in the format
>>>hh:mm:ss.

>>[quoted text clipped - 6 lines]
>>>
>>> Thanks!

>
>
> Roger - Thanks for the suggestion. You have a great site. The form that
> you
> have the calculations done on is what I am looking for, but I need it in a
> query. A query won't take the same formula that you are using. Do you
> have
> any suggestions? Thanks!
>
> --
> Message posted via AccessMonster.com
> http://www.accessmonster.com/Uwe/For...ccess/200701/1
>



 
Reply With Quote
 
CompassDBA via AccessMonster.com
Guest
Posts: n/a
 
      30th Jan 2007
Roger Carlson wrote:
>Specifically which formula is not working in a query?
>
>>>On my website (www.rogersaccesslibrary.com), is a small Access database
>>>sample called "ConvertStringStuff.mdb" which illustrates how to do this

>[quoted text clipped - 12 lines]
>> have
>> any suggestions? Thanks!


Your formula is converting time to string and I am converting string to time.
=ConvertDateToStringTime(ConvertStringTimeToDate([time1])
+ConvertStringTimeToDate([time2])+ConvertStringTimeToDate([time3]),"HH:MM")

I am not using it exactly that way, I just tried the formula
ConvertDateToString just to see if I could get it to work in a query. But I
am converting from Text to time in the format HH:MM:SS. Thanks for your help
with this.

--
Message posted via http://www.accessmonster.com

 
Reply With Quote
 
Roger Carlson
Guest
Posts: n/a
 
      30th Jan 2007
I'm not sure what you're saying, but when I put this:
Expr1: ConvertDateToStringTime(ConvertStringTimeToDate([time1])
+ConvertStringTimeToDate([time2])+ConvertStringTimeToDate([time3]),"HH:MM")

into a query, it works just fine for me.

--
--Roger Carlson
MS Access MVP
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/...UBED1=ACCESS-L

"CompassDBA via AccessMonster.com" <u30801@uwe> wrote in message
news:6d100389928c1@uwe...
> Roger Carlson wrote:
>>Specifically which formula is not working in a query?
>>
>>>>On my website (www.rogersaccesslibrary.com), is a small Access database
>>>>sample called "ConvertStringStuff.mdb" which illustrates how to do this

>>[quoted text clipped - 12 lines]
>>> have
>>> any suggestions? Thanks!

>
> Your formula is converting time to string and I am converting string to
> time.
> =ConvertDateToStringTime(ConvertStringTimeToDate([time1])
> +ConvertStringTimeToDate([time2])+ConvertStringTimeToDate([time3]),"HH:MM")
>
> I am not using it exactly that way, I just tried the formula
> ConvertDateToString just to see if I could get it to work in a query. But
> I
> am converting from Text to time in the format HH:MM:SS. Thanks for your
> help
> with this.
>
> --
> Message posted via http://www.accessmonster.com
>



 
Reply With Quote
 
CompassDBA via AccessMonster.com
Guest
Posts: n/a
 
      30th Jan 2007
Roger Carlson wrote:
>I'm not sure what you're saying, but when I put this:
>Expr1: ConvertDateToStringTime(ConvertStringTimeToDate([time1])
>+ConvertStringTimeToDate([time2])+ConvertStringTimeToDate([time3]),"HH:MM")
>
>into a query, it works just fine for me.
>
>>>Specifically which formula is not working in a query?
>>>

>[quoted text clipped - 15 lines]
>> help
>> with this.

I get the error "undefined function".

--
Message posted via http://www.accessmonster.com

 
Reply With Quote
 
Roger Carlson
Guest
Posts: n/a
 
      30th Jan 2007
Is the ConvertDateToStringTime() function in a General Module or is it in
behind a form?

--
--Roger Carlson
MS Access MVP
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/...UBED1=ACCESS-L

"CompassDBA via AccessMonster.com" <u30801@uwe> wrote in message
news:6d11b10af6e09@uwe...
> Roger Carlson wrote:
>>I'm not sure what you're saying, but when I put this:
>>Expr1: ConvertDateToStringTime(ConvertStringTimeToDate([time1])
>>+ConvertStringTimeToDate([time2])+ConvertStringTimeToDate([time3]),"HH:MM")
>>
>>into a query, it works just fine for me.
>>
>>>>Specifically which formula is not working in a query?
>>>>

>>[quoted text clipped - 15 lines]
>>> help
>>> with this.

> I get the error "undefined function".
>
> --
> Message posted via http://www.accessmonster.com
>



 
Reply With Quote
 
CompassDBA via AccessMonster.com
Guest
Posts: n/a
 
      30th Jan 2007
Roger Carlson wrote:
>Is the ConvertDateToStringTime() function in a General Module or is it in
>behind a form?
>
>>>I'm not sure what you're saying, but when I put this:
>>>Expr1: ConvertDateToStringTime(ConvertStringTimeToDate([time1])

>[quoted text clipped - 8 lines]
>>>> with this.

>> I get the error "undefined function".


I am just trying to run it in a query. I am not using a form or anything.

--
Message posted via http://www.accessmonster.com

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I convert time as text 'mm:ss to time value in Excel Sholto Microsoft Excel Misc 5 1st Apr 2009 05:40 AM
convert time to text =?Utf-8?B?Y2hlY2tR?= Microsoft Excel Misc 9 11th May 2007 08:31 PM
Convert Text Time to Excel Time william.mcseveney@ntlworld.com Microsoft Excel Misc 5 29th Jan 2007 04:43 PM
convert time imported as text to time format for calculations =?Utf-8?B?YmF0ZmlzaA==?= Microsoft Excel Worksheet Functions 3 27th Oct 2005 11:24 PM
Convert text to time value Andy Microsoft Excel Misc 4 19th Nov 2004 06:10 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:20 AM.