BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Time conversion with Format function

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder Databases (Desktop)
View previous topic :: View next topic  
Author Message
Patrick FAURE
Guest





PostPosted: Mon Feb 23, 2004 10:25 am    Post subject: Time conversion with Format function Reply with quote




Hi,

I want to store time data in a table.
I use for this TQuery component.
First I make my SQL statement with Format function.
I decided to use %f parameter for Time data.
AnsiString UsesSQLStatement;
UsesSQLStatement = Format("INSERT INTO %s (IdURi, UseDate,
StartTime, EndTime, Duration, ComputerAddress, Status)
VALUES (%d, "%s", %1.8f, %1.8f, %1.8f, "%s", "%s")",
OPENARRAY(TVarRec,(
asUTableName,
IdURi,
DateToStr(Date()),
(double)DtTmStartTime,
(double)DtTmEndTime,
(double)Duration,
computerAddress,
status)));
QrInsertU->SQL->Add(UsesSQLStatement);

When I run my application, there isan error: Parameter no correct.
When I debug my program I see in SQL statement that my 3 Time
data are converted like this :
0,00,0,00,0,00 and not like the right format that is
0.00,0.00,0.00 so the SQL is not correct.
How can I do to have the correct conversion? Is it a bug of the
Format function ?
Thanks for your answers.
Patrick
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder Databases (Desktop) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.