Home » SQL & PL/SQL » SQL & PL/SQL » where clause between to sysdates
where clause between to sysdates [message #665440] Wed, 06 September 2017 00:45 Go to next message
dhuuk42
Messages: 1
Registered: September 2017
Junior Member
hello there!

i'd like to have a where clause for a report which automatically adds following conditions

 where tbl_out_order.host_delivery_date Between sysdate and sysdate + 4

so i'd like to ask in the report the date from today to 4 days in the future.

as far as i understand this is something of code i need, but i don't know how to integrate this code into the where clause Sad

SELECT TO_CHAR 
(SYSDATE, 'YYYYMMDD') as today
from dual
Re: where clause between to sysdates [message #665441 is a reply to message #665440] Wed, 06 September 2017 03:26 Go to previous messageGo to next message
cookiemonster
Messages: 13919
Registered: September 2008
Location: Rainy Manchester
Senior Member
I don't understand the problem. Why isn't the first snippet what you need?
What is the point of the second snippet?
Re: where clause between to sysdates [message #665443 is a reply to message #665441] Wed, 06 September 2017 04:13 Go to previous messageGo to next message
Littlefoot
Messages: 21807
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Maybe this?
where tbl_out_order.host_delivery_date Between trunc(sysdate) and trunc(sysdate) + 4
Re: where clause between to sysdates [message #665446 is a reply to message #665443] Wed, 06 September 2017 04:51 Go to previous message
cookiemonster
Messages: 13919
Registered: September 2008
Location: Rainy Manchester
Senior Member
Or more likely

tbl_out_order.host_delivery_date >= trunc(sysdate)
and tbl_out_order.host_delivery_date < trunc(sysdate) + 5
Previous Topic: how to extract data from oracle table having space in column name using vba code?
Next Topic: phone type sql
Goto Forum:
  


Current Time: Tue Apr 16 04:22:07 CDT 2024