Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

to_date or not to_date ...

skippaskippa Member Posts: 1
Here goes ...
I'm attempting to insert data from vb6 into sql tables using a query. Something like

Please note that value1, value2 and value3 are all text's, ie: user input ...

insert into stuff
values (:value1,
to_date(:value2,'dd-mon-yy'),
:value3)

This makes vb crash and burn. I'm sure the date thing is wrong, so any direction would be greatly appreciated.

Thanks for your time ...
Ken.

Comments

  • saurabh101saurabh101 Member Posts: 41
    : Here goes ...
    : I'm attempting to insert data from vb6 into sql tables using a query. Something like
    :
    : Please note that value1, value2 and value3 are all text's, ie: user input ...
    :
    : insert into stuff
    : values (:value1,
    : to_date(:value2,'dd-mon-yy'),
    : :value3)
    :
    : This makes vb crash and burn. I'm sure the date thing is wrong, so any direction would be greatly appreciated.
    : Thanks for your time ...
    : Ken.

    I guess it should be,
    [code]
    insert into stuff
    values (:value1,
    to_date(:value2,'dd-mm-yy'), 'mm instead of mon
    :value3)
    [/code]

    [code]
    m = Display the month as a number without a leading zero (1 12). If
    m immediately follows h or hh, the minute rather than the month is
    displayed.
    mm = Display the month as a number with a leading zero (01 12). If m
    immediately follows h or hh, the minute rather than the month is
    displayed.
    mmm = Display the month as an abbreviation (Jan Dec).
    mmmm = Display the month as a full month name (January December).
    [/code]
  • Andre YoungAndre Young USAMember Posts: 0

    _______ [ http://forcoder.org ] free video tutorials and ebooks about | PL/SQL Python Ruby JavaScript C# Assembly MATLAB Scratch Perl Visual Basic Visual Basic .NET Swift Objective-C C Delphi R Java PHP C++ Go FoxPro Scheme Julia ML Rust Crystal Dart Hack Logo Kotlin F# Erlang Awk Apex Lua SAS COBOL Clojure Fortran Scala Transact-SQL Alice Ada ABAP LabVIEW Prolog Lisp VBScript D Bash | ____

Sign In or Register to comment.