Home » SQL & PL/SQL » SQL & PL/SQL » Need Help In Dates (sql Oraccle)
Need Help In Dates [message #669399] Sat, 21 April 2018 18:08 Go to next message
Djpats
Messages: 17
Registered: January 2018
Junior Member
hi guys.

how do i calculate below dates i.e every monday to thursday




Summary of Credit Note requested from Monday (DD/MM/YYY) to Thursday (DD/MM/YYYY) :




any help will be appreciated


pfa,
i have added screen of my requirment

thank you in advance
Re: Need Help In Dates [message #669400 is a reply to message #669399] Sat, 21 April 2018 19:05 Go to previous messageGo to next message
EdStevens
Messages: 1167
Registered: September 2013
Senior Member
many sites block links. Many users (myself included) refuse to open them for the same reason others block them.

Can you write a query against tables for which you do not know the structure and the names of the columns? Well, neither can anyone else.

Please provide (directly in your post, not as an attachemnt) the CREATE TABLE and some INSERT statements to allow someone to reproduce a test case, then a description of the output you desire and the logic of how that ouput is derived from the given data.

That said, your row is going to need a column for the date, and that column should be defined as DATE. Then

SELECT something
FROM mytable
WHERE MYDATE BETWEEN TO_DATE('04-01-2018','MM-DD-YYYY')
                 and to_date('04-15-2018','mm-dd-yyyy')
;
Re: Need Help In Dates [message #669401 is a reply to message #669400] Sat, 21 April 2018 19:17 Go to previous messageGo to next message
BlackSwan
Messages: 26649
Registered: January 2009
Location: SoCal
Senior Member
Please read and follow the forum guidelines, to enable us to help you:
OraFAQ Forum Guide
How to use {code} tags and make your code easier to read
Re: Need Help In Dates [message #669402 is a reply to message #669399] Sat, 21 April 2018 20:20 Go to previous message
Solomon Yakobson
Messages: 2910
Registered: January 2010
Location: Connecticut, USA
Senior Member
It is not clear what exactly you mean by "monday to trursday". I will assume Monday, 00:00:00 - Thursday 23:59:59:

where dt >= trunc(dt,'iw')
  and dt < trunc(dt,'iw') + 4

SY.
Previous Topic: SQL rollup count every day
Next Topic: Polish Characters are missing through the SQLPLUS
Goto Forum:
  


Current Time: Wed Jan 29 03:37:54 CST 2020