Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Inserting VB6 date variables in Oracle 8i date fields

Status
Not open for further replies.

Palmero

Technical User
Mar 31, 2001
53
0
0
FR
See the following attached code to give me an idea on how to insert VB date variables in Oracle V8i date fields.

Dim start_time As Date
Dim end_time As Date
Dim Return_code as integer

start_time = Now()
Return_code = My_proc(Transaction, response, err)
end_time = Now()

duration = DateDiff("s", start_time, end_time)


QSQL = "Update MY_TABLE set duration=" & duration & ",start_time='" & start_time & "',end_time='" & end_time & "'"
Set Squery = Cn.CreateQuery("", QSQL)
Squery.Execute


THE UPDATE DOES NOT WORK.
I have the execution error : 40002
S1000:[Oracle][ODBC][Ora]ORA-01830


Thanks in advance for your idea.

Palmero
 
use the to_date function.
set start_time = to_date('&start_time','ddmmyy')
if you want the time as well then add hhmiss
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top