[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Crystal Reports - Add one hour to a time

Posted on 2009-12-21
1
Medium Priority
?
660 Views
Last Modified: 2013-11-15
Hi,

I have a field in my database where the user writes a time. The field is a string.

Suppose the field contains the string 17:30 - which represents a time of 17:30.

I want a formula to display 16:30 - 18:30 (ie. subtract one hour from the start, and add one hour to te end)

How can I do this?
0
Comment
Question by:MDWinter
1 Comment
 
LVL 101

Accepted Solution

by:
mlmcc earned 2000 total points
ID: 26097070
Try this formula

Local TimeVar myTime;
Local TimeVar startTime;
Local TimeVar endTime;

myTime := Time({YourTimeField});

startTime := Time(DateAdd('h',-1,DateTime(CurrentDate,myTime )));
endTime := Time(DateAdd('h',1,DateTime(CurrentDate,myTime )));

CStr(startTime,'HH:mm') & ' - ' & CStr(endTime,'HH:mm')

mlmcc
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
Hi, In my previous Article  (http://www.experts-exchange.com/Database/Reporting/A_15199-Introduction-to-Microstrategy.html)I discussed some basic understanding of Microstrategy that how we can get in Intro of Microstrategy (MSTR). Now it's tim…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses

834 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