Display WeekDayname as Mon,Tue,Wed...

Hello,
I have a formula in crystal to display the weekday name

WeekdayName(DayOfWeek ((today-1)) ) this displays Tuesday

Is there any way to display as 'Tue' just the 3 letters.
Star79Asked:
Who is Participating?
 
mlmccCommented:
Try

WeekDayName(DayOfWeek(Today -1), True)

WeekDayName has an optional parameter to abbreviate.  False is the default value.

You can also use
     CStr(Today - 1, 'ddd')

    ToText(Today -1, 'ddd')

mlmcc
1
 
plusone3055Commented:
give this a try :)

Dim i As String = WeekdayName(DayOfWeek ((today-1)) )

i.Substring(0, 3)
0
 
Star79Author Commented:
there doesnt seem to be a substring in crystal
0
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

 
plusone3055Commented:
are you using Crystal for Visual Studio ??
what version are you using ?
0
 
Star79Author Commented:
hello,
Yes this question is posted in the crystal reports zone.iam using crystal11
Thanks.
0
 
plusone3055Commented:
ah okay in that situation then
LEFT (WeekdayName(DayOfWeek ((today-1)) ),3)
0
 
plusone3055Commented:
mlmcc

I dont have crystal open atm but left would also work correct ???

if you look at hte thread i origianlly thought of a substring but they are not using visual studio..

just curious as to my LEFT solution working ??
0
 
Star79Author Commented:
yes the LEFT solution also works
0
 
plusone3055Commented:
just wanted to make sure was doing that on the fly  woohoo :)
0
 
mlmccCommented:
It will work when the abbreviation is 3 letters as in English.  Other languages may not always use 3 letters.

It also may be slower since there are extra function calls which may not be as efficient as the single function call using the tools available.

mlmcc
0
 
Star79Author Commented:
not sure whom to award points
0
 
plusone3055Commented:
usually whoever got a correct answer first
or if it makes you feel better split the points between us :)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.