If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > query

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-29-10, 13:15
calamaris calamaris is offline
Registered User
 
Join Date: Aug 2010
Posts: 21
query

hi . i have this table and i want to create a query for identify any instrument(s) that have not been returned past their rental due date

create table InstStatus( InstStatus_ID integer not null primary key,
InstStatus_available varchar(20),
InstStatus_IssueDate Date,
InstStatus_ExpDate Date,
InstStatus_DurDate integer,
Cust_ID integer,
Inst_SN integer);
Reply With Quote
  #2 (permalink)  
Old 08-30-10, 15:29
Lenny77 Lenny77 is offline
Registered User
 
Join Date: Jul 2009
Location: NY
Posts: 886
Lightbulb

It could be something like following query:

Code:
select * from InstStatus
Where InstStatus_ExpDate < current date
  and InstStatus_ExpDate < InstStatus_IssueDate + InstStatus_DurDate day
;
Lenny

Last edited by Lenny77; 08-30-10 at 16:07.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On