Print Page | Close Window

Hardcode time in datetime

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=19168
Printed Date: 02 May 2024 at 12:16pm


Topic: Hardcode time in datetime
Posted By: Yarra
Subject: Hardcode time in datetime
Date Posted: 24 Feb 2013 at 5:39am
How can I hard code the 'time' part of the datetime value on a report? e.g When ever the datetime value field has time greater than 7am it should display the actual datetime, if less than 7am it should display the actual date and time as 7:00:00




Replies:
Posted By: DBlank
Date Posted: 25 Feb 2013 at 4:00am
if time(field)<time(7,0,0) then date(field)+time(7,0,0) else field


Posted By: Yarra
Date Posted: 25 Feb 2013 at 5:42am
worked, thanks!



Print Page | Close Window