Convert time field to text

V

vseale

I have an access 2000 table I want to append into a linked
SQL table. The time field needs to be converted to text
during the append. Any hints are greatly appreciated.
Thanks in advanced for your help.
 
G

Guest

I saw that in Help and interpreted to mean it converted
text to Time. I need to convert Time to Text. I'm
appending recordsets to a SQL table, so I was anticipating
that there was some SQL-like command that I missed,
something like - DoCmd.RunSQL "INSERT INTO tblIMC_Hold (
TICKET, COMPLETE, convert([TimeCreat],DateTime(),Text
(50)), TASK)";.
 
J

John Vinson

You interpreted it incorrectly! Format () always returns a text
string, as should have been clear from my example. The second argument
is the DateTime variable to be converted; the first argument is a text
string indicating the format to be used in the conversion.

I think you have that backwards, Peter; the first argument is the
value to be formatted, and the second is the format string. That is,

Format([datetimefield], "hhnn")

will convert the current time (as I post this, though of course
'tempus fugit') to a text string "1448".


John W. Vinson[MVP]
Join the online Access Chats
Tuesday 11am EDT - Thursday 3:30pm EDT
http://community.compuserve.com/msdevapps
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top