Click here to Skip to main content
15,896,474 members
Home / Discussions / Database
   

Database

 
GeneralRe: New to databases need help Pin
numbrel7-Mar-05 10:34
numbrel7-Mar-05 10:34 
GeneralRe: New to databases need help Pin
Mattb797-Mar-05 11:33
Mattb797-Mar-05 11:33 
GeneralRe: New to databases need help Pin
numbrel8-Mar-05 3:51
numbrel8-Mar-05 3:51 
GeneralRe: New to databases need help Pin
Mattb798-Mar-05 6:04
Mattb798-Mar-05 6:04 
GeneralRe: New to databases need help Pin
numbrel9-Mar-05 8:06
numbrel9-Mar-05 8:06 
GeneralStatements with Predicates Pin
Melvin_MCW5-Mar-05 6:11
Melvin_MCW5-Mar-05 6:11 
GeneralRe: Statements with Predicates Pin
NassosReyzidis10-Mar-05 0:47
NassosReyzidis10-Mar-05 0:47 
GeneralDate Time shows different Pin
Tom Wright4-Mar-05 5:54
Tom Wright4-Mar-05 5:54 
I have a field set with a type of datetime size 8. When I run an SQL statement like this
SELECT     TOP 1 MDC1_DATA_TEXT, MDC1_REV_DATE<br />
FROM         MDC1<br />
WHERE     (MDC1_I_O = 'O')
thru the qurey analyzer I get this:

2005-02-25 16:12:07.373

When I run the statement thru enterprise manager by right clicking on the table and choosing open table return all rows then clicking on the SQL button in the toolbar and running my statement, I get this:

2/25/2005 4:12:07 PM

This is the same thing that comes across when I run my SQL statement in my program. The problem is that this "2/25/2005 4:12:07 PM" does not contain milliseconds which is part of the primary key and needed to delete the record after reading it in. Does anyon know how to have SQL return back the other date time stamp?

Here is my code that I'm using in my program:
<br />
	try<br />
	{<br />
		pCommand.CreateInstance(__uuidof(Command));<br />
		pCommand->ActiveConnection = m_pConnection;<br />
		//pCommand->CommandText = _bstr_t("SELECT TOP 1 MDC1_DATA_TEXT, MDC1_REV_DATE FROM MDC1 WHERE (MDC1_I_O = 'O')");<br />
		pCommand->CommandText = _bstr_t("SELECT TOP 1 * FROM MDC1 WHERE (MDC1_I_O = 'O')");<br />
		pRecordset.CreateInstance(__uuidof(Recordset));<br />
		pRecordset->CursorLocation = adUseClient;<br />
		pRecordset->Open((IDispatch*) pCommand, <br />
			vtMissing,<br />
			adOpenStatic,<br />
			adLockBatchOptimistic,<br />
			adCmdUnknown);<br />
		_variant_t MDC1_DATA_TEXT;<br />
		_variant_t MDC1_REV_DATE;<br />
<br />
		while (!pRecordset->adoEOF)<br />
		{<br />
			CString mySQLData = (char*)(_bstr_t)pRecordset->Fields->GetItem("MDC1_DATA_TEXT")->Value;<br />
			//Get the reverse date time stamp so that we can use it for later.<br />
			//MDC1_REV_DATE = pRecordset->GetCollect("MDC1_REV_DATE");<br />
			CString revDate = (char*) (_bstr_t)pRecordset->Fields->GetItem("MDC1_REV_DATE")->Value;<br />

Should I set my pointer for the rev_date to something else?

Thanks


Tom Wright
tawright915@yahoo.com
GeneralRe: Date Time shows different Pin
numbrel5-Mar-05 3:45
numbrel5-Mar-05 3:45 
GeneralRe: Date Time shows different Pin
Rob Graham5-Mar-05 12:08
Rob Graham5-Mar-05 12:08 
GeneraloracleDataAdapter &amp; Parameters Pin
Gerder3-Mar-05 0:56
Gerder3-Mar-05 0:56 
GeneralRe: oracleDataAdapter &amp; Parameters Pin
numbrel7-Mar-05 10:38
numbrel7-Mar-05 10:38 
Generalinsert record into field names that contain brackets Pin
elephantstar2-Mar-05 8:08
elephantstar2-Mar-05 8:08 
GeneralRe: insert record into field names that contain brackets Pin
Michael Potter4-Mar-05 4:23
Michael Potter4-Mar-05 4:23 
GeneralSql Stored Procedure Pin
Mahesh16791-Mar-05 18:40
Mahesh16791-Mar-05 18:40 
GeneralRe: Sql Stored Procedure Pin
Anonymous1-Mar-05 19:00
Anonymous1-Mar-05 19:00 
GeneralRe: Sql Stored Procedure Pin
Mahesh16791-Mar-05 22:16
Mahesh16791-Mar-05 22:16 
GeneralRe: Sql Stored Procedure Pin
Tom Wright4-Mar-05 9:21
Tom Wright4-Mar-05 9:21 
GeneralOleDbDataAdapter.Update() should throw error but doesn't Pin
Florent Geffroy1-Mar-05 3:37
Florent Geffroy1-Mar-05 3:37 
GeneralRe: OleDbDataAdapter.Update() should throw error but doesn't Pin
Rob Graham5-Mar-05 12:20
Rob Graham5-Mar-05 12:20 
GeneralRe: OleDbDataAdapter.Update() should throw error but doesn't Pin
Florent Geffroy6-Mar-05 21:49
Florent Geffroy6-Mar-05 21:49 
Generalmultiple db systems in one app Pin
schilled1-Mar-05 2:45
schilled1-Mar-05 2:45 
GeneralRe: multiple db systems in one app Pin
-Dr_X-19-Mar-05 16:49
-Dr_X-19-Mar-05 16:49 
GeneralRe: multiple db systems in one app Pin
schilled20-Mar-05 22:22
schilled20-Mar-05 22:22 
GeneralSearching by degree of separation Pin
who2who228-Feb-05 23:19
who2who228-Feb-05 23:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.