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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to change date to text CR8.5?

Status
Not open for further replies.

Digitalcandy

IS-IT--Management
May 15, 2003
230
US
I've tried;

ToText({table.datefield}, "M/dd/yy")

Visually the above looks ok but there is a space in day portion of the string. It converts like below;

actual date field = 2/5/04
after formula conversion = 2/ 5/04

What am I doing wrong?
 
Try:

ToText({table.datefield}, "M/d/yy")

You can also just right click the date field and select format field and format the date however you'd like.

-k
 
Sorry for the confusion but that is what I did. I didn't mean to write my code as M/dd/yy. I am actually using M/d/yy. However, it seems to create an empty space in day section when it is less than day 10.

For instance;

date field = 2/5/04
ToText date field = 2/ 5/04

I need it to be a text field because if the date meets a certain criteria the field will display the character " - ".
 
Sounds odd, it shouldn't do that.

Try applying the latest service pack:


Here's an alternative:

totext(month({table.datefield}),0,"")+"/"+totext(day({table.datefield}),0,"")+"/"+totext(year({table.datefield}),0,"")

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top