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

Condtional Date Info

Status
Not open for further replies.

SDS100UK

MIS
Jul 15, 2001
185
GB
Hi,

I am very grateful for the help I have received so far from this site, it has been very useful however--

I need to know how to have a text string appear if part of the date says Sunday. My date format is long.

What code would i need for this??

Thanks again in advance

Steven
 
if this field is already a date field, you can right click on it and select format field, customize, then click on the date tab, can adjust all kinds of stuff..

Hope this helps..

 
Not sure if this is what you mean...

If ToText({YourDateField}, 'dddd') = 'Sunday' then
'Date is Sunday'
else
'Date is not a Sunday'
 
What do you mean by "if part of the date is Sunday?"
What data type is this field as seen by CR.
If you don't know, see the FAQ on data types in the general forum. Ken Hamady, On-site/Phone Crystal Reports Training/Consulting
Quick Reference Guide to using Crystal in VB
 
Ken,

The data type is Date.
To clarify what I mean here is an example:
Sunday 5th August 2001.
What I want is a certain string to appear if the day is Sunday.

Thanks

Steven
 
If the data type is seen as a date by CR then you can use the following:


If DayOfWeek ( {your.field} ) = 1
then "Your String"
else "" Ken Hamady, On-site/Phone Crystal Reports Training/Consulting
Quick Reference Guide to using Crystal in VB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top