This content has been marked as final. Show 6 replies
I do the conversion on server side which resolves this problem
And how can I make it if I can only access the table using c++ ?
If You have access to query texts
write "to_char(someday, 'dd/mm/rrrr')" instead of writing "someday"
If You don't - contact Your DBA or database developer to rewrite sqls
oresult GetFieldValue(int index, char *buffer, unsigned short maxlen) const
I have tryed with:
odyn.Open(odb, "select * TO_CHAR(PERIOD_END_DATE, 'DD/MM/YYYY HH:MI:SS' from my_table", ODYNASET_NOCACHE | ODYNASET_READONLY);
but it doesn't work.
I have olso tryed with odyn.SetSQL() followed with odyn.Refresh() but always not to do, if I read the SateTime field in a char string or in an int its value is always wrong.
Tank you for the help velvet2, I have found the solution by myself and it is:
struct tm *m_t;
time_t t = mm_period_end;
time( &t );
m_t = localtime( &t ); // Convert time to struct tm form
sprintf_s( ss, "%s", asctime( m_t ) );
int dd = m_t->tm_mday;
int mm = m_t->tm_mon + 1;
int yy = m_t->tm_year + 1900;
select * TO_CHAR(PERIOD_END_DATE, 'DD/MM/YYYY HH:MI:SS' from my_table
This is not valid sql query
Valid examples are:
select TO_CHAR(PERIOD_END_DATE, 'DD/MM/YYYY HH:MI:SS' from my_table
select t.*, TO_CHAR(PERIOD_END_DATE, 'DD/MM/YYYY HH:MI:SS' from my_table t