Solved

Crystal Reports - Replace certain text from database

Posted on 2004-08-04
3
1,006 Views
Last Modified: 2010-05-18
We are using Crystal Reports 8.  We have a report already created, but the person who will be using it wants a date field of a record in the report changed if the time for that record is 11pm.

Source of the data is an SQL database that we cannot edit.  I need to know where I can put in an "If/Then" so that when a record's time is 11pm, for it to display the date of that record -1 day.  For Example, the record in the database would have the following:

wc_schedule_part_tool_view.time_schd = 11pm
wc_schedule_part_tool_view.date_schd = 08/04/04

We want it to then display this record as:

wc_schedule_part_tool_view.time_schd = 11pm
wc_schedule_part_tool_view.date_schd = 08/03/04

Thanks.
0
Comment
Question by:Luniz2k1
  • 2
3 Comments
 
LVL 42

Accepted Solution

by:
frodoman earned 500 total points
ID: 11719217
What you need to do is instead of displaying the wc_schedule_part_tool_view.date_schd field, create a formula that will output the display.  Your formula would be this:

if hour({wc_schedule_part_tool_view.time_schd}) = 23 then
   DateAdd('d',-1,{wc_schedule_part_tool_view.date_schd })
else
   {wc_schedule_part_tool_view.date_schd}

Use the formula instead of the date field and you're all set.

frodoman
0
 
LVL 5

Author Comment

by:Luniz2k1
ID: 11719597
Perfect.  Thank you very much.
0
 
LVL 42

Expert Comment

by:frodoman
ID: 11719611
Glad I could help - frodoman
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now