I am writing some data to my database and i want to sort it by date/time so i need to put a timestamp on my entries.
I have coded this right now
i know that the timestamp is wrong but can someone make it right for me ? :D
str.Format("UPDATE webcapsdeployment SET Build='%s',Date2='%s', Dbweek='%s', Employe='%s', Comments='%s',
Timestamp='now()' WHERE Platform = 'SAND'",m_sSandBuild, m_sSandDate, m_sSandDbweek, m_sSandEmploye, m_sSandComments);
This link provides information about getting the time, it uses MFC. As I am familiar with neither MFC nor time and date functions, I cannot explain. The article is very specific however, and will hopefully be what you are looking for. :) not to mention its about 1 or 2 lines of code, depending on your coding style.
I think your statement may be right if you remove the apostrophes around now().