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 > "in" problem in DB2

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-05-07, 11:57
mandla.srinivas mandla.srinivas is offline
Registered User
 
Join Date: Jan 2007
Posts: 6
"in" problem in DB2

Thanks Rahul for your previous answer

SELECT * FROM TFCT_CNTCT where date(TFCT_CNTCT.STRT_DT)
in
(
'01/05/2007', '01/04/2007'
)
is getting executed and giving results

------------------------------------------------------

but the following statement is not giving results.

SELECT * FROM TFCT_CNTCT where date(TFCT_CNTCT.STRT_DT)
in
(
select current date,current date -1 day from sysibm.sysdummy1
)

you could send me the answers to mandla.srinivas@gmail.com
Reply With Quote
  #2 (permalink)  
Old 01-05-07, 12:23
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
Try this:

SELECT * FROM TFCT_CNTCT where date(TFCT_CNTCT.STRT_DT)
in
(
select current date from sysibm.sysdummy1
UNION ALL
select current date -1 day from sysibm.sysdummy1
)
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
Reply With Quote
  #3 (permalink)  
Old 01-05-07, 12:32
mandla.srinivas mandla.srinivas is offline
Registered User
 
Join Date: Jan 2007
Posts: 6
Thank You

thank you very much Marcus
Reply With Quote
  #4 (permalink)  
Old 01-05-07, 17:04
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
or
Code:
SELECT * FROM TFCT_CNTCT where date(TFCT_CNTCT.STRT_DT)
in (values current date, current date -1 day)
Reply With Quote
  #5 (permalink)  
Old 01-07-07, 08:13
Peter.Vanroose Peter.Vanroose is offline
Registered User
 
Join Date: Sep 2004
Location: Belgium
Posts: 1,079
or even
Code:
SELECT *
FROM   TFCT_CNTCT
WHERE  date(STRT_DT) in (current date, current date - 1 day)
__________________
--_Peter Vanroose,
__IBM Certified Database Administrator, DB2 9 for z/OS
__IBM Certified Application Developer
__ABIS Training and Consulting
__http://www.abis.be/
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