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

Removing decimals when putting a date field formula together

Status
Not open for further replies.

neronikita

Technical User
Feb 20, 2002
159
US
Good morning!

I am using Crystal Reports 2008 and SQL Server 2008. I have two fields: MonthLoaded and DateLoaded. I'm trying to put these together along with the year to create a formatted date: 07/01/2011. I'm getting 7.00/1.00/2011. My formula is (truncate({Dispatch2011.MonthLoaded},0)) & "/" & (truncate({Dispatch2011.DateLoaded},0)) & "/" & "2011"

How do I get this to format correctly? I thought truncate would do it, but it's not working. Any thoughts or suggetions? I also tried using "totext".

Thanks!

Di
 
Nevermind - when I combined totext with the ,0 after the formula, it worked.

totext({dispatch2011.dateloaded},0)
 
You could also have done
Code:
ToText({dispatch2011.dateloaded}, "dd/MM/yyyy")
Quite a few other options, your Crystal HELP should give details.

[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 11.5 with SQL and Windows XP [yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top