Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Problemas with function Format()


Hi!!!

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

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

My date base accepts the following format: (I was testing this in othe
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

--
dmplaceb
-----------------------------------------------------------------------
dmplacebo's Profile: http://www.excelforum.com/member.php...fo&userid=2509
View this thread: http://www.excelforum.com/showthread.php?threadid=38637

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Problemas with function Format()

Better to stay in the original thread.

--
Regards,
Tom Ogilvy

"dmplacebo" wrote
in message ...

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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Format within a Function JAC Excel Worksheet Functions 1 January 11th 10 07:58 PM
how do you write format results of a function within a function? sangee Excel Worksheet Functions 3 June 14th 07 12:45 AM
format & function yshridhar Excel Discussion (Misc queries) 3 May 10th 07 05:35 AM
Format NOW function Todd Huttenstine Excel Programming 2 February 3rd 05 07:21 PM
the function FORMAT() Jonas Excel Discussion (Misc queries) 1 January 28th 05 03:53 PM


All times are GMT +1. The time now is 07:05 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"