Click to See Complete Forum and Search --> : How to insert a date field in oracle table


November 20th, 1999, 08:00 AM
I am using VB5 and oracle as backend I want to insert a date value in a date field of a table. what insert statement shoud i use??
i tried number of permutations.
e.g.
sqlstr = "insert into customerqry(cid,Billing_End_Date) values(1, " & Format("20/11/1999", "short date") & ")"
it is giving me errror.
please anyone help me. it is a bit urgent.

thyanx in advance

kieran_rush
November 22nd, 1999, 09:36 AM
What I do to insert a date into Oracle is like the example

Global Q as String
Global Conn as new ADODB.Connection
Global Qenter as String

Public Sub Oracle ()
Qenter = chr(10)

Q = "INSERT INTO XXXXX"
Q = Q & "VALUES (TO_DATE('" & txtdate & "','mm/dd/yyyy'))
Conn.Execute Q

End Sub

I hope this helps you