formatting a date CString
- From: Dave Cullen <nospam@xxxxxxxx>
- Date: Mon, 28 Aug 2006 14:39:05 -0400
I have a date/time string in the form "2006-09-25 23:59:59" that I need
to save to a database column. The schema describes the column as a DATE
data type (Otacle). I'm using a CString.Format() method to build the SQL
INSERT statement.
If I format the string as text with single quotes '%s' the Oracle driver
says bad format. If I leave the quotes off, the whitespace in the middle
looks like 2 parameters.
I'd like to avoid invoking any date conversions that might be database
specific, as the database could be Access or SQL Server someday.
What to do?
.
- Follow-Ups:
- Re: formatting a date CString
- From: Tim Roberts
- Re: formatting a date CString
- From: William DePalo [MVP VC++]
- Re: formatting a date CString
- Prev by Date: Re: C2124 is most disrespectful of IEEE floating point arithmetic
- Next by Date: Re: C2124 is most disrespectful of IEEE floating point arithmetic
- Previous by thread: Why do I need a copy constructor?
- Next by thread: Re: formatting a date CString
- Index(es):
Relevant Pages
|