to_date or not to_date ...

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

  • : 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]
Sign In or Register to comment.

Howdy, Stranger!

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

Categories

In this Discussion