Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Format of Month 1

Status
Not open for further replies.

Jengo

Programmer
Apr 17, 2000
100
US
I know how to get the month its ..... Trim(Month(Now)) .... but that displays a 4 (this month).  I want it to display a 04 for any month under 10 and everything over display regularly.  Example:  01,02,03,04,05,06,07,08,09,10,11,12?
 
it would be simpler to use <b><font color=red>datepart</font></b> and the <b>now()</b> function:<br><i><b>datepart (&quot;mm&quot;, [now()] ) </b></i><br><br>or format your date field(s) mm (a single 'm' will not provide the leading zero)
 
I have tried to incorporate this function into my existing one with no success.&nbsp;&nbsp;Can anyone help me?&nbsp;&nbsp;This is what I have so far.&nbsp;&nbsp;I want to change the Trim(Month(Now())) to the suggested style above.<br><br><br>User.Text = &quot;00&quot; & Trim(Month(Now())) & Trim(Day(Now()))
 
User.Text = Format$(Now(),&quot;yymmdd&quot;)<br><br>I'm assuming that the 00 is for the year 2000.<br><br>If the 00 has to be there even in 2001, then<br>User.Text = &quot;00&quot; & Format$(Now(),&quot;mmdd&quot;)<br>
 
Month2:IIf(Month([Date])&lt;10,&quot;0&quot;,&quot;&quot;) & Month(Date])
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top