473,406 Members | 2,439 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Check a date on a DB2 table to see if it falls within the last 24 hours.

The date is in datetime format. I need to do this check in a SQL join statement, but my results don't appear correct.

Expand|Select|Wrap|Line Numbers
  1. SELECT emp_ID, emp_EFF_DT
  2. FROM EMP_EMPLOYEE
  3. left outer join INS_COVERAGE ON emp_ID = ins_ID and
  4.  current time > emp_EFF_DT  and
  5. ((current time - 24 hours) < emp_EFF_DT)
Jan 5 '16 #1
1 2476
Rabbit
12,516 Expert Mod 8TB
Probably because the date restriction needs to go in the WHERE clause and not the JOIN clause. But you don't provide enough information for us to diagnose the exact issue.
Jan 5 '16 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Pawel Wrobel | last post by:
Hi! I have a folowing situation - in my Access database I have a table that is linked with SPS. I put some data into this table to present it no SPS. The thing is that when I have no connection...
2
by: zjut | last post by:
In c#, Microsoft sql 2000, the name of db is "tc",and i want to check the table "csharp" is exist or not . if it isnot exist, create it.! ====================================== SqlCommand cmd =...
7
by: Hieronimus | last post by:
Hi all I inherited a server running MySQL 4.* from a previous developer. Now, the records on this database might be what I want, or they might just be test data. I think my only chance of...
3
by: ryanmhuc | last post by:
Is it possible to have a dynamic table name within a query or a table name that is a variable? This does not work but gives an example: SELECT * FROM concat('table', 'name') - OR - SET @table...
13
by: citizenprice | last post by:
I have three fields in a Union Access Query (ID, Begin_Date, End_Date). I want to modify the query to include a parameter date to be entered by the user and produce a result if the parameter date...
10
by: viki1967 | last post by:
Help with check date and hours Hi all. I have this form: <html> <head>
1
by: mamabeav54 | last post by:
i have created a record on a linked table from within ms access using a stored procedure in sql server 2005. the insert record proc sends a 0 return code. i can view the record, but when i try to...
4
by: Phil Davis | last post by:
Hi I'm struggling to find an elegant way of determining whether the date from a record falls within a number of date boundaries ranges. For example in a separate (date boundaries) table I code the...
1
by: emmaruth | last post by:
Hi I would like to ask the correct formula in Excel. I would like to sum up the total number of hours per staff and then how many hours and minutes left or excess within 8 hours. Here's my table:...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.