date format

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • puruji
    New Member
    • Feb 2007
    • 1

    #1

    date format

    while importing date field from excel to oracle using VB6 i got a problem in date format....they do no match...in excel it gives date in format mm/dd/yy but in oracle i need dd-mm-yyyy so? to do.
    insert into tbl_cboss_data( mobileno,client ,DATE_ACTIVATIO N_SWITCH,Applic ation,TARIFF,us er_name,machine ip,machinetime) values('" & rs.Fields(1) & "','" & rs.Fields(2) & "','" & rs.Fields(8) & "','" & rs.Fields(9) & "', '" & rs.Fields(10) & "','" & MainForm.susern ame & "','" & MainForm.LocalI nf & "','" & MainForm.EntryD ateTime & "'
    for third field date i have done using '" & rs.Fields(8) & "' :this is field from excel
    ? change need to done....using VB code......i have use adodb connection
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    use oracle conversion Function TO_DATE

    Comment

    • Killer42
      Recognized Expert Expert
      • Oct 2006
      • 8429

      #3
      Originally posted by debasisdas
      use oracle conversion Function TO_DATE
      Another option is to use the VBA Format() function to format the value the way you want, before you put it in the string.

      Comment

      • Mayur2007
        New Member
        • Aug 2007
        • 67

        #4
        Hi,

        Try this in vb6.0
        Format(Date, "dd/mm/yyyy")
        or
        Format(Date, "dd-mm-yyyy")

        its for system date.

        that might be helpful for u.

        Mayur

        Comment

        Working...