I don't think that is necessary. SQL Server will store a datetime value in 24 hour format with the seconds.

Frank.

Frank Cazabon

On 14/10/2013 01:16 PM, Jeff Johnson wrote:
Doh! I guess I don't understand all I know about this. ;^) I also created a procedure to convert the datetime() to a properly formatted string with single quotes around it and that worked great. I wanted to make sure hours were set to 24 and seconds were on anyway.

Thanks Steve & Frank

Jeff

---------------

Jeff Johnson
[email protected]
(623) 582-0323

www.san-dc.com
www.arelationshipmanager.com

On 10/14/2013 09:32 AM, Frank Cazabon wrote:
On 14/10/2013 12:01 PM, Jeff Johnson wrote:

Frank: I am building a string for SQL Pass through and am getting an error. How would I put that in a string:

lcSQL = 'INSERT INTO DB.TABLE (astringfield, adatefield) VALUES ("' + m.string + '", ?m.MyDateTime)'

What is the error?

I am guessing it is because SQL does not use double quotes, so switch them around like this.

m.lcSQL = "INSERT INTO DB.TABLE (astringfield, adatefield) VALUES ('" + m.string + "', ?m.MyDateTime)"

In order to avoid that I would do:

TEXT TO m.lcSQL NOSHOW TEXTMERGE
INSERT INTO DB.TABLE (astringfield, adatefield) VALUES (?m.string, ?m.MyDateTime)
ENDTEXT

(I made m.string a parameter too)

or

TEXT TO m.lcSQL NOSHOW TEXTMERGE
INSERT INTO DB.TABLE (astringfield, adatefield) VALUES ('<< m.string>>', ?m.MyDateTime)
ENDTEXT



Frank.

Frank Cazabon


[excessive quoting removed by server]

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to