Print Page | Close Window

Subtracting datetime fields.?

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=22294
Printed Date: 01 May 2024 at 1:32pm


Topic: Subtracting datetime fields.?
Posted By: cbaldwin
Subject: Subtracting datetime fields.?
Date Posted: 17 Apr 2017 at 4:24am
When subtracting 2 datetime fields in a Crystal Command table select statement (statement below)

(dd.draw_start_datetime - d.birthdate)/365.25) as age,

i get data in the following format.

+000000041 22:52:55.890410959

Is there a way to manipulate this to display just the "41"? The 41 represents 41 years.

Note that I have to do this within a Crystal Command table using SQL.




Replies:
Posted By: hilfy
Date Posted: 17 Apr 2017 at 6:48am
What database are you connecting to? The syntax will be based what the database is.

-Dell

-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics


Posted By: cbaldwin
Date Posted: 17 Apr 2017 at 6:52am
Thank you for taking the time to respond. I received a resolution from an offsite user with the same software.



Print Page | Close Window