Solved

Crystal Reports - Replace certain text from database

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

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. …
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

776 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