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

Date Format within Crystal Reports

Status
Not open for further replies.

dannyb29

Technical User
Nov 10, 2010
90
GB
Good Afternoon,
Can anyone help me with a formula to convert a date field.

From

15/01/2011 12:00:01

To

110115

Thank you!x
 
@date
totext(year(datefield)-2000,"00",0,"") &
totext(month(datefield),"00",0,"") &
totext(day(datefield),"00",0,"")

Of course in 89 years you will need to modify, but I don't think we should worry about that ;-)

Ian
 
Thank you but I think the brackets are little out? Its throwing up errors. Tried to fix it but no joy???

:eek:)
DB
 
I just tried the formula and it worked just fine for me. Are you using a date field? I only had datetime field to check it against.

What are the error messages?
 
totext(year(datefield)-2000,"00") &
totext(month(datefield),"00") &
totext(day(datefield),"00")

-LB
 
Hiya

Here is the code

totext(year(AVBTransactionLog.ActionDateTime)-2000,"00") &
totext(month(AVBTransactionLog.ActionDateTime),"00") &
totext(day(AVBTransactionLog.ActionDateTime),"00")


Keeps saying "The ) is missing"

:(
DB
 
You should be adding your field in place of "datefield"--and if you add it from the field list, it will automatically be surrounded by curly brackets {}. These are missing in your formula:

totext(year({AVBTransactionLog.ActionDateTime})-2000,"00") &
totext(month({AVBTransactionLog.ActionDateTime}),"00") &
totext(day({AVBTransactionLog.ActionDateTime}),"00")

-LB

 
You are the best!!! If I could kiss you I would!
Thank you!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top