Format date in CR8 formula as mm/dd/yyyy

Here's an existing formula in CR8:

ToText({MainSource.MY_DATE},"m-d-yy")) & ' / a bunch of other stuff..'

When I run it, it always displays 0 as the month, and everything else looks fine.  Is there a month character that is not m?

TIA
-Jim
LVL 66
Jim HornMicrosoft SQL Server Developer, Architect, and AuthorAsked:
Who is Participating?
 
bdreed35Connect With a Mentor Commented:
ToText({MainSource.MY_DATE},"M-d-yy"))

Month placeholder needs to be a capital M.

0
 
janmariniCommented:
Try "mm".    If this dosen't help, please share your formula and expected results.
0
 
janmariniCommented:
ToText({MainSource.MY_DATE},"MM-d-yy"))

Here's all the formatting strings (see Crystal Help...)

Format strings for Date, Time, and DateTime values
The following characters are used to create format strings for Date, Time, and DateTime values:

Character  Comments  
d
 day of month without leading zero for single digits
 
dd
 day of month with leading zero for single digits.
 
ddd
 day of week as a three letter abbreviation
 
dddd
 full name of day of week
 
M
 month without leading zero for single digit
 
MM
 month with leading zero for single digit
 
MMM
 month as three letter abbreviation.
 
MMMM
 full name of month
 
yy
 last two digits of year
 
yyyy
 full four digits of year
 
h
 hours without leading zeros for single digits (12 hour)
 
hh
 hours without leading zeros for single digits (12 hour).
 
H
 hours without leading zeros for single digits (24 hour)
 
HH
 hours with leading zeros for single digits (24 hour)
 
m
 minutes without leading zeros for single digits
 
mm
 minutes with leading zeros for single digits
 
s
 seconds without leading zeros for single digits
 
ss
 seconds with leading zeros for single digits
 
t, tt
 single character or multiple character a.m./p.m. string
 

0
 
Jim HornMicrosoft SQL Server Developer, Architect, and AuthorAuthor Commented:
Thanks guys.  -Jim
0
All Courses

From novice to tech pro — start learning today.