Solved

Crystal Reports - Replace certain text from database

Posted on 2004-08-04
3
1,007 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
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 …
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
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…

863 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

25 Experts available now in Live!

Get 1:1 Help Now