+ Reply to Thread
Results 1 to 2 of 2

Problemas with function Format()

  1. #1
    Registered User
    Join Date
    07-11-2005
    Posts
    9

    Problemas with function Format()

    Hi!!!

    Thanks for your information but... I've got a doubt about the things you've told me.

    The macro that I'm using receives the param "Dia" in DATE format but I'm not sure if this is the best option or if I should change to string format.

    My date base accepts the following format: (I was testing this in other software)

    TO_DATE('29/06/2005 22:59:00','DD/MM/YYYY HH24:MI:SS')

    where Dia=29/06/2005 22:59:00

    The problem is that I can't use the function TO_DATE in the VBA code, that means I must use the function Format() or not????.

    How can I include my param "Dia" in the appropiate format???.

    Thank you, thank you and thank you again.

    David.


    T_BLOC_ARRET.C_BA__DATE_DE_DEB=ADUT >""" & Format(Dia,"mm-dd-yy") & """

    Note the changed string part:

    """ &
    Format(Dia,"mm/dd/yy") & """

    The date should be enclosed in quotes, but since youre inside a string
    you need to double them. Also you need to convert the date to a string
    again for the SQL, so you need to know which string format is accepted
    by the SQL source (I assume american date format)

  2. #2
    Tom Ogilvy
    Guest

    Re: Problemas with function Format()

    Better to stay in the original thread.

    --
    Regards,
    Tom Ogilvy

    "dmplacebo" <[email protected]> wrote
    in message news:[email protected]...
    >
    > Hi!!!
    >
    > Thanks for your information but... I've got a doubt about the things
    > you've told me.
    >
    > The macro that I'm using receives the param "Dia" in DATE format but
    > I'm not sure if this is the best option or if I should change to string
    > format.
    >
    > My date base accepts the following format: (I was testing this in other
    > software)
    >
    > TO_DATE('29/06/2005 22:59:00','DD/MM/YYYY HH24:MI:SS')
    >
    > where Dia=29/06/2005 22:59:00
    >
    > The problem is that I can't use the function TO_DATE in the VBA code,
    > that means I must use the function Format() or not????.
    >
    > How can I include my param "Dia" in the appropiate format???.
    >
    > Thank you, thank you and thank you again.
    >
    > David.
    >
    >
    > T_BLOC_ARRET.C_BA__DATE_DE_DEB=ADUT >""" & Format(Dia,"mm-dd-yy") & """
    >
    >
    > Note the changed string part:
    >
    > """ &
    > Format(Dia,"mm/dd/yy") & """
    >
    > The date should be enclosed in quotes, but since youre inside a string
    > you need to double them. Also you need to convert the date to a string
    > again for the SQL, so you need to know which string format is accepted
    > by the SQL source (I assume american date format)
    >
    >
    > --
    > dmplacebo
    > ------------------------------------------------------------------------
    > dmplacebo's Profile:

    http://www.excelforum.com/member.php...o&userid=25095
    > View this thread: http://www.excelforum.com/showthread...hreadid=386378
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1