# Crystal Date Functions

Hello I have the below formula;
``````cstr(Date (CurrentDateTime-30)) +' To '+ cstr(date((CurrentDateTime-22)))
``````
This is displaying 8/12/2013 To 8/20/2013
How can I change the formula to show 8/12/13 to 8/20/13
Can it be done?
###### Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Commented:
0
Commented:
sorry  missing brackets
this will work :)

0
Author Commented:
Your formula is giving 8/12/2013  12:00:00AM To 8/20/2013  12:00:00AM

I only want to see date field as 8/12/13.
2013 is cut short to just 13.Can it be done?
0
Commented:
in that case you need to make two fields and combine them
so make a textobject
and two formula fields

formula 1

formula 2

them make a textobject

@formula 1  to  @formula2

works perfectly :)
0
Commented:
in that case you need to make two fields and combine them
so make a textobject
and two formula fields

formula 1

formula 2

them make a textobject

@formula 1  to  @formula2

works perfectly :)
0
Author Commented:
actually this what is working

ToText((today-22),"MM/dd/yy") +' - '+ ToText((today-30),"MM/dd/yy")
0
Commented:
Actual answer is to reverse your fields to get it into the correct order.

mlmcc
0
Author Commented:
Mlmcc,
sorry I coudlnt get it, my formula
ToText((today-1),"MM/dd/yy") +' - '+ ToText((today-7),"MM/dd/yy")
displays
09/10/13 - 09/04/13
0
Commented:
You have the from and to reversed

ToText((today-7),"MM/dd/yy") & '-' & ToText((today-1),"MM/dd/yy")

mlmcc
0

Experts Exchange Solution brought to you by

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Commented:
Star
I think that was really wrong I had the working formula before mlmcc(no offense to him he is a great poster)

In the future please award points accordingly
0
Commented:
He had the answer, just had the dates in the wrong order.  I just pointed that out and he couldn't figure out how to reverse them.

Your formula didn't set the formats as desired.  That was the original question how to show only a 2 digit year.

mlmcc
0
Commented:
mlmcc
My mistake
I was writing these answers in transit
I thought it had the correct date format
I retract my previous statement :)
0
Commented:
No problem.  If you had your default set in global preferences to be a 2 digit year what you tried might have produced the desired result.

If your idea had worked, he would have accepted it before I posted that his solution had the wrong order.

mlmcc
0
###### It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Crystal Reports

From novice to tech pro — start learning today.