Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.basic.visual.misc > #2230 > unrolled thread

Re: How To insert Date From VB6.0 to Oracle #2

Started bytonisukmana <tonie_id@yahoo.com>
First post2015-01-19 12:12 -0600
Last post2015-01-20 09:22 +0000
Articles 3 — 3 participants

Back to article view | Back to comp.lang.basic.visual.misc

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: How To insert Date From VB6.0 to Oracle #2 tonisukmana <tonie_id@yahoo.com> - 2015-01-19 12:12 -0600
    Re: How To insert Date From VB6.0 to Oracle #2 GS <gs@somewhere.net> - 2015-01-19 16:31 -0500
    Re: How To insert Date From VB6.0 to Oracle #2 Deanna Earley <dee@earlsoft.co.uk> - 2015-01-20 09:22 +0000

#2230 — Re: How To insert Date From VB6.0 to Oracle #2

Fromtonisukmana <tonie_id@yahoo.com>
Date2015-01-19 12:12 -0600
SubjectRe: How To insert Date From VB6.0 to Oracle #2
Message-ID<oPudnaIWF7aX1CDJnZ2dnUU7-VWdnZ2d@giganews.com>
how to format the date plus hours minutes seconds ? I got the error
vardate = Format ( ADate , "dd-mmm-yyyy hh:mm:ss" )

db.Execute("Insert into FZTempTbl(EntryDate) Values(" & _
"TO_DATE('" & vardate  & "')

any one help me??

[toc] | [next] | [standalone]


#2231

FromGS <gs@somewhere.net>
Date2015-01-19 16:31 -0500
Message-ID<m9jt2t$s8m$1@dont-email.me>
In reply to#2230
> how to format the date plus hours minutes seconds ? I got the error
> vardate = Format ( ADate , "dd-mmm-yyyy hh:mm:ss" )
>
> db.Execute("Insert into FZTempTbl(EntryDate) Values(" & _
> "TO_DATE('" & vardate  & "')
>
> any one help me??

Does your date include time? This does...

  ?format(now(), "dd-mmm-yyyy hh:mm:ss")

..and returns...

  "19-Jan-2015 16:28:07"

..when typed in the Immediate Window!

-- 
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
  comp.lang.basic.visual.misc
  microsoft.public.vb.general.discussion

[toc] | [prev] | [next] | [standalone]


#2232

FromDeanna Earley <dee@earlsoft.co.uk>
Date2015-01-20 09:22 +0000
Message-ID<m9l6s3$aed$1@speranza.aioe.org>
In reply to#2230
On 19/01/2015 18:12, tonisukmana wrote:
> how to format the date plus hours minutes seconds ? I got the error
> vardate = Format ( ADate , "dd-mmm-yyyy hh:mm:ss" )
>
> db.Execute("Insert into FZTempTbl(EntryDate) Values(" & _
> "TO_DATE('" & vardate  & "')

It must be in a specific format:
http://docs.oracle.com/cd/B19306_01/server.102/b14200/sql_elements003.htm#BABGIGCJ
(First result for "oracle sql date literal")

db.Execute "Insert into FZTempTbl(EntryDate) Values(TIMESTAMP '" & 
Format(vardate, "yyyy-mm-dd hh:mm:ss") & "')"

-- 
Deanna Earley (dee@earlsoft.co.uk, dee@doesnotcompute.co.uk)

(Replies direct to my email address will be printed, shredded then fed 
to the rats. Please reply to the group.)

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.basic.visual.misc


csiph-web