|
Hi Todd, Does this get your selections? SELECT * from abc where (now() - RVCRDT) >= 80000.00 Eric DeLong Sally Beauty Company MIS-Project Manager (BSG) 940-297-2863 or ext. 1863 -----Original Message----- From: midrange-l-bounces@xxxxxxxxxxxx [mailto:midrange-l-bounces@xxxxxxxxxxxx]On Behalf Of todd.sabella@xxxxxxxxxxxxx Sent: Tuesday, June 27, 2006 8:04 AM To: MIDRANGE-L@xxxxxxxxxxxx Subject: SQL - Calculate the number of hours between 2 timestamps Folks, With SQL,I am trying to determine if the time stamp value in a field (RVCRDT) within a file (RTPRVER) is more than 8 hours old. SELECT hour(NOW() - timestamp(RVCRDT)) , timestamp(RVCRDT) as create_date, NOW() FROM RTPRVER WHERE hour(NOW() - timestamp(RVCRDT)) >= 8 I thought that the HOUR function would give me what I needed, but it seems to be just subtracting the hours portions of the timestamp fields. Here's some results that I'm getting. Obviously, I'm missing something HOUR CREATE_DATE NOW ( ) 8 2006-01-02-00.46.36.000000 2006-06-27-08.47.19.481856 8 2006-02-12-00.31.37.000000 2006-06-27-08.47.19.481856 8 2006-02-13-00.17.26.000000 2006-06-27-08.47.19.481856 8 2006-02-13-00.17.37.000000 2006-06-27-08.47.19.481856 8 2006-02-13-00.24.35.000000 2006-06-27-08.47.19.481856 8 2006-02-13-00.36.11.000000 2006-06-27-08.47.19.481856 Any help would be appreciated!!!!! Thanks Todd -- "NOTICE: The information contained in this electronic mail transmission is intended by Convergys Corporation for the use of the named individual or entity to which it is directed and may contain information that is privileged or otherwise confidential. If you have received this electronic mail transmission in error, please delete it from your system without copying or forwarding it, and notify the sender of the error by reply email or by telephone (collect), so that the sender's address records can be corrected."
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.