Print Page | Close Window

Add time (minutes) by a formula

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=8845
Printed Date: 06 May 2024 at 8:15am


Topic: Add time (minutes) by a formula
Posted By: Memoli28
Subject: Add time (minutes) by a formula
Date Posted: 09 Jan 2010 at 8:48am
Hi All,
 
I know there is a dateadd syntax in crystal ,but is there also a syntax for 'time'add?
 
I have the following field:datetimevalue
 
What kind of syntax do i need to add 20 minutes extra for the time?
 
example:(datetimevalue field)
 
01/01/2010  13:55:00 --> 01/01/2010  14:15:00
 
and what kind of syntax for only a time-field? (without date)
 
 
regards,
Memoli
 



Replies:
Posted By: FrnhtGLI
Date Posted: 11 Jan 2010 at 5:32am

create a formula:

dateadd('n', +20, datetimevalue field)
 
Drop the formula in your report, then right-click the field=>Format Field=>Date and Time (tab) and choose a time only display Style from the list.
 
Hope that works for ya.


Posted By: Memoli28
Date Posted: 12 Jan 2010 at 10:54am
Hi member_profile.asp?PF=7355&FID=5 - FrnhtGLI ,
 
the formula is working.
 
thank you so much, especially the field formatting for a datetime field.
 
i created many formulas to show some details,like month /date .
 
Never took a look in the field which was a datetimevalue.
 
regards,
Memoli

 


Posted By: HEMREDDY
Date Posted: 28 Nov 2013 at 2:32am
Hi,
 
I have a date and time field and i want to use selection expert and filter records using Current date minus 15 minutes. The date filed on my Table is live and gets updated from the system date on every transaction.  
 
Hem


Posted By: Sastry
Date Posted: 28 Nov 2013 at 2:39am
hi
 
use below formula in your record selection :
 
{databasefield} >=dateadd('m',-15,currentdate) and {databasefield}<=currentdate
 
 


-------------
Thanks,
Sastry


Posted By: HEMREDDY
Date Posted: 28 Nov 2013 at 3:23am
Hi,
 
This worked good. Just made a few changes.
 
{DlyTrn.trndte}>= dateadd('n',-15,CurrentDateTime) and
{DlyTrn.trndte}<= CurrentDateTime
 
Thanks for the help.



Print Page | Close Window