Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 441
Default Return double digit month

Is there a way to return a two digit month using the MONTH function? i.e. 01,
02, 03, 04, etc.

For example, when I try: Format(Month(dteDate), "MM")

It does not return the correct month...how can I get at this? I'm sure I
know how to do this, but it's a Monday and I'm dragging...

Thanks much in advance.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Return double digit month


Format(Month(dteDate), "00")

HTH,
Bernie
MS Excel MVP


"quartz" wrote in message
...
Is there a way to return a two digit month using the MONTH function? i.e.

01,
02, 03, 04, etc.

For example, when I try: Format(Month(dteDate), "MM")

It does not return the correct month...how can I get at this? I'm sure I
know how to do this, but it's a Monday and I'm dragging...

Thanks much in advance.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,440
Default Return double digit month

If dteDate is a real date, just use Format(dteDate,"mm")

--

Kind Regards,

Niek Otten

Microsoft MVP - Excel

"quartz" wrote in message
...
Is there a way to return a two digit month using the MONTH function? i.e.
01,
02, 03, 04, etc.

For example, when I try: Format(Month(dteDate), "MM")

It does not return the correct month...how can I get at this? I'm sure I
know how to do this, but it's a Monday and I'm dragging...

Thanks much in advance.



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
Return a 3 digit number Patrick C. Simonds Excel Worksheet Functions 2 January 30th 09 07:35 AM
add a double digit number together adding double digit numbers Excel Discussion (Misc queries) 14 December 7th 08 07:02 PM
recognizing double digit numbers in code DB Excel Discussion (Misc queries) 3 March 2nd 07 04:43 PM
Convert 2 digit month to 4 digit years and months BB Excel Worksheet Functions 2 September 17th 06 09:33 PM
how to convert single digit to month name cygnus Excel Worksheet Functions 4 April 27th 06 05:16 PM


All times are GMT +1. The time now is 04:49 PM.

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"