Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Diff between date fields in minutes

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Diff between date fields in minutes
 Login/Join
 
Member
posted
Help!! I need to develop a report that takes 2 date fields (SQLSRVR Date-Time stamp) and computes the difference between them in minutes. I can't seem to find a date function that utilizes the time portion of the date-time stamp. This will be utilized to determine how many hours someone works on a given day derived from timeclock data.

Any help would be greatly appreciated!!
Thanks!
Chuck
 
Posts: 12 | Registered: May 05, 2004Report This Post
Master
posted Hide Post
I believe the function you are looking for is

HDIFF

HDIFF: Finding the Number of Units Between Two Date-Time Values

HDIFF(value1, value2, 'component', outfield) where:

value1: Is the end date-time value, the name of a date-time field that contains the value, or an expression that returns the value.

value2: Is the start date-time value, the name of a date-time field that contains the value, or an expression that returns the value.

component: Is the name of the component to be used in the calculation enclosed in single quotation marks. If the component is a week, the WEEKFIRST parameter setting is used in the calculation.

outfield: Alphanumeric, Is the field that contains the result, or the format of the output value enclosed in single quotation marks. The format must be floating-point double-precision.

In WebFOCUS, you must specify the format. In Maintain, you must specify the name of the field.
 
Posts: 865 | Registered: May 24, 2004Report This Post
Member
posted Hide Post
Thanks for the post TS!

That's the function I was looking at too, but couldn't find any documentation on the "component" piece of the syntax. I've seen examples of 'Day', 'Month', 'Year' used to compute the differences in those respective time slices....but no example of a difference between dates in say....'minutes'? Would the component be 'minute' or perhaps 'seconds'?

Thanks!
Chuck
 
Posts: 12 | Registered: May 05, 2004Report This Post
<Pietro De Santis>
posted
HDIFF(value1, value2, 'component', outfield)

Component
---------
year
quarter
month
day-of-year
day
are
week
weekday
hour
minute
second
millisecond
microsecond

I find the Date Functions documentation in the Using Functions manual not very easy to use. Look for "Reference: Arguments for Use With Date and Time Functions".
 
Report This Post
Member
posted Hide Post
Thanks Pietro!! Works like a charm!

Your soooo right about the date documentation!
 
Posts: 12 | Registered: May 05, 2004Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Diff between date fields in minutes

Copyright © 1996-2020 Information Builders