Calculate the start and end date in Connect By - during Hirerchy changes
/ * Formatted 05/20/2013 09:53 (PS5 v5.115.810.9015) * /.Oracle Database 11 g Enterprise Edition Release 11.2.0.3.0 - 64 bit Production
Hello, can you please help me or guide me in the calculation of the dates of beginning and end to the underside of logic
I want to calculate the Hirerchy Manager to the Agent.
Then under query works fine and its giving me the expected results
But when there is a change in the Hirerchy Manager or manager gets promoted
Then I need to calculate the start date and end date.
CREATE TABLE PERSON_DTL
(
SID VARCHAR2(10 BYTE),
EMP_MGRS_ID VARCHAR2(10 BYTE),
START_EFFECTIVE_DT DATE,
END_EFFECTIVE_DT DATE
);
Insert into PERSON_DTL
(SID, EMP_MGRS_ID, START_EFFECTIVE_DT, END_EFFECTIVE_DT)
Values
('M100', 'M107', TO_DATE('05/20/2013 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('12/31/9999 00:00:00', 'MM/DD/YYYY HH24:MI:SS'));
Insert into PERSON_DTL
(SID, EMP_MGRS_ID, START_EFFECTIVE_DT, END_EFFECTIVE_DT)
Values
('M101', 'M102', TO_DATE('01/01/2010 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('05/18/2013 00:00:00', 'MM/DD/YYYY HH24:MI:SS'));
Insert into PERSON_DTL
(SID, EMP_MGRS_ID, START_EFFECTIVE_DT, END_EFFECTIVE_DT)
Values
('A100', 'M100', TO_DATE('01/01/2010 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('12/31/9999 00:00:00', 'MM/DD/YYYY HH24:MI:SS'));
Insert into PERSON_DTL
(SID, EMP_MGRS_ID, START_EFFECTIVE_DT, END_EFFECTIVE_DT)
Values
('M100', 'M101', TO_DATE('01/01/2010 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('05/18/2013 00:00:00', 'MM/DD/YYYY HH24:MI:SS'));
Insert into PERSON_DTL
(SID, EMP_MGRS_ID, START_EFFECTIVE_DT, END_EFFECTIVE_DT)
Values
('M107', 'M102', TO_DATE('05/20/2013 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('12/31/9999 00:00:00', 'MM/DD/YYYY HH24:MI:SS'));
Insert into PERSON_DTL
(SID, EMP_MGRS_ID, START_EFFECTIVE_DT, END_EFFECTIVE_DT)
Values
('M102', 'M103', TO_DATE('01/01/2010 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('12/31/9999 00:00:00', 'MM/DD/YYYY HH24:MI:SS'));
Insert into PERSON_DTL
(SID, EMP_MGRS_ID, START_EFFECTIVE_DT, END_EFFECTIVE_DT)
Values
('M103', 'M104', TO_DATE('01/01/2010 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('12/31/9999 00:00:00', 'MM/DD/YYYY HH24:MI:SS'));
Insert into PERSON_DTL
(SID, EMP_MGRS_ID, START_EFFECTIVE_DT, END_EFFECTIVE_DT)
Values
('A101', 'M105', TO_DATE('01/01/2010 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('12/31/9999 00:00:00', 'MM/DD/YYYY HH24:MI:SS'));
Insert into PERSON_DTL
(SID, EMP_MGRS_ID, START_EFFECTIVE_DT, END_EFFECTIVE_DT)
Values
('M105', 'M106', TO_DATE('01/01/2010 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('12/31/9999 00:00:00', 'MM/DD/YYYY HH24:MI:SS'));
COMMIT;
SELECT CONNECT_BY_ROOT (b.sid) agent_sid,
TRIM (
LEADING ',' FROM SYS_CONNECT_BY_PATH (b.sid, ',')
|| ','
|| b.emp_mgrs_id
)
PATH,
START_EFFECTIVE_DT Start_dt,
END_EFFECTIVE_DT End_dt
FROM PERSON_DTL b
WHERE CONNECT_BY_ISLEAF = 1
START WITH sid IN ('A101', 'A100')
CONNECT BY PRIOR b.emp_mgrs_id = b.sid
This is the results that i am getting now.
AGENT_SID PATH START_DT END_DT
A100 A100,M100,M101,M102,M103,M104 1/1/2010 12/31/9999
A100 A100,M100,M107,M102,M103,M104 1/1/2010 12/31/9999
A101 A101,M105,M106 1/1/2010 12/31/9999
Results Required
A100 A100,M100,M101,M102,M103,M104 1/1/2010 5/18/2013
A100 A100,M100,M107,M102,M103,M104 5/20/2013 12/31/9999
A101 A101,M105,M106 1/1/2010 12/31/9999
WITH the CLAUSE will make it readable
SQL> with paths as
2 (
3 SELECT CONNECT_BY_ROOT (b.sid) agent_sid,
4 TRIM (
5 LEADING ',' FROM SYS_CONNECT_BY_PATH (b.sid, ',')
6 || ','
7 || b.emp_mgrs_id
8 )
9 PATH,
10 START_EFFECTIVE_DT Start_dt,
11 END_EFFECTIVE_DT End_dt,rownum rn
12 FROM PERSON_DTL b
13 START WITH sid IN ('A101', 'A100')
14 CONNECT BY PRIOR b.emp_mgrs_id = b.sid
15 ),
16 flagged as
17 (
18 select agent_sid,
19 path,
20 start_dt,
21 end_dt,rn,
22 case when path like lag(path) over(order by rn)||'%' then 0 else 1 end flg
23 from paths
24 ),
25 summed as
26 (
27 select agent_sid,path,start_dt,end_dt,
28 sum(flg) over(order by rn) sm
29 from flagged
30 )
31 select agent_sid,max(path) path,max(start_dt) start_dt,
32 min(end_dt) end_dt
33 from summed
34 group by agent_sid,sm
35 order by agent_sid;
AGENT_SID PATH START_DT END_DT
---------- ---------------------------------------- --------- ---------
A100 A100,M100,M101,M102,M103,M104 01-JAN-10 18-MAY-13
A100 A100,M100,M107,M102,M103,M104 20-MAY-13 31-DEC-99
A101 A101,M105,M106 01-JAN-10 31-DEC-99
Tags: Database
Similar Questions
-
Simple validation on the start and end dates
Apex 4.2
I'm trying to create a script of validation on my start date and end date. A simple validation indicating the start date must be less than the end date. Because apex deals my fields of date as a string, using an expression of pl/sql as P101_START_DATE < = P101_END_DATE does not work. This may seem like an easy question, but I'm unable to create this simple validation. Any help would be greatly appreciated. Thanks in advance!
Take a look how the TO_DATE plsql function works... ie... to_date(:P101_START_DATE,'mm-DD-yyyy')<=to_date(:P101_END_DATE,'mm-dd-yyyy'),>=to_date(:P101_END_DATE,'mm-dd-yyyy'),>
-
Need help to calculate the start and end time and place the result in a term like text box
I did a search on the forum for calculating start and end time and found the code depending on which I am using as a formcalc on the duration field.
==============================================================
Form1. Page1.duration::calculate - (FormCalc, client)
If (HasValue (StartTime) and HasValue (EndTime)) then
industrial var = Time2Num (StartTime.formattedValue, "h: mm A")
var = Time2Num out_ (EndTime.formattedValue, "h: mm A")
If (IN2 > = out_) then
xfa.host.messageBox ("start time cannot be greater than or equal to the end time.")
$.rawValue = null
on the other
var out_ - IN2 = diff
$.rawValue = diff/3600000
endif
on the other
$.rawValue = null
endif
=============================================================
Then, when I enter for example from 15:30, an hour of beginning and end of 04:00
The duration field will say 0.5
How can I get my form to say 30 minutes instead of placing a decimal?
Secondly, how can I use field models LC where the employee can just type 330 or 03:30 and it automatically based on the computer's clock on time to start 15:30?
Any help will be greatly appreciated. Thank you.Attached is the form for display:
https://Acrobat.com/#d=f1kxh5qjuow5ujyZduF8OQ
To view the results in a regular time format, you can use:
$.rawValue = Num2Time (diff/3600000, "HH: mm")
For a flexible time entry check this example.
http://thelivecycle.blogspot.com/2011/05/flexible-Eingabe-von-Daten-und-Zeiten.html
-
Can I add start and end dates to flex in WCS assets?
Hi all
I have to add the start and end dates to my flex belt and make it visible on the plus edition + inspect mode. For the Fund, it is STANDARD, but I have an obligation to do so for other assets that is not active promotion.
Is there any doc/blog I can do? Help, please.
Hi Avi.
Dates of start and end standards are OOTB field in the metadata of the asset. So they you must set the cs.sitepreview property in the file futuretense.ini in the 'management '.
CS.sitepreview = ContentManagement
You can check out the documentation for more details about this property: futuretense.ini - 11 g Release 1 (11.1.1.8.0)
If you need something different, maybe you need create your own attributes Start Date and end using types date: Data Design: active models - 11 g Release 1 (11.1.1.8.0)
Kind regards
Raul.
-
Photoshop CC 2015 is a line connecting the start and end of the brush strokes
Hi guys,.
I had a strange problem with a certain brush (size 5px, difficult tour, no shape dynamics, no transfer) in Photoshop CC 2015.1.2.
It only happens when the drawing very fast on my Cintiq 22HD.
The problem is PS is a line connecting the start and end of the brush strokes. I don't hold in shift or whatever it is.
I use a PC with these specs:
Intel Core i7 - 4790 K 4.00 GHz
ASUS motherboard
NVIDIA GeForce GTX 970 (10.18.13.5354 driver version)
16 GB OF RAM
Cintiq 22HD
Win 10
Is it a question of PS or Cintiq?
Thanks for help.
OK, here is therefore an update.
The problem is not at all with Photoshop or Cintiq, with Windows 10 parameters of the stylus.
Fortunately, there is a small piece of free software that you can download called "Fix my pen" (by Smith Reddy) which defines the features of Windows Tablet PC in the registry for you (essentially by disabling everything related to it):
viziblr - News - difficulty my pen makes your Wacom tablet JUST WORK on Windows 7
It works fine on Win10 too.
Now, as my original problem with Photoshop to do a line connecting the start and end of the brush strokes left, however I have another question more small that came after running difficulty my pen. The lines that I draw now are not smoothed by a software more. You can see the difference below.
Fix My Pen sets a lot of things in the registry, but you cannot individually control which setting is disabled. So I guess that one of them is the cause.
I expect response from Smith about it, cause I have no idea who he is.
-
Primavera P6 API - start and end dates of the activity in the secondary reference scenario
How to seek early and dates of activity in the secondary database or tertiary reference end? There are areas of activities and methods provided in planning extraction and primary base line project (active class getBaseline1StartDate(), getBaseline1FinishDate) but can't find any secondary data or tertiary basis even if we show them in details the activity in the Primavera. I use Primavera integration API version 8.2.
Use the BaselineProjectHelper class to get a list of all the base lines for a given project. Go through the list looking for basic lines you are interested in.
Once you have basic interest projects, pull a list of ongoing project activities.
Browse the list of activities tearing you start and end dates.
Call the method on each of you loadBaselineActivity of reference projects for the departure of the referenced activity and end dates.
For performance, seek assistance loadBaselineActivities to reduce database queries.
V/r,
Gene
-
Find records overlapping start and end dates
Hi all
I have a table with begin and end date columns. I need to find the records that overlap with a few values in corresponding column.
Table: MG_AUTH_AGNT
-----
ID
MGATH_clnt
MGATH_beg_DT
MGATH_END_DT
MGATH_SERV_GRP
MGATH_STAT
MGATH_TYP
MGATH_NHIC_ERR_CD
-----
I need to find records containing dates that overlap.
Examples of data
-----
If the customer has two records with the same MGATH_SERV_GRP, MGATH_STAT, MGATH_TYP and start and end dates of the first disc are 01/JAN/2009 AND 01 / JAN / 2009.
start and end dates of second record are 15/JAN/2009 and 15/FEB/2009.
Here are the dates overlap. with my select query, I should get these two recordings.
I am using the following query. But it is too slow. Could you please suggest a better sql?
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Select MG_AUTH_AGNT m, MGATH_clnt, MGATH_beg_DT, MGATH_END_DT, MGATH_NHIC_ERR_CD, id where m.MGATH_SERV_GRP = '1' and m.MGATH_STAT = 'A' and MGATH_clnt = (select distinct MGATH_clnt of MG_AUTH_AGNT d where d.MGATH_SERV_GRP = m.MGATH_SERV_GRP and d.MGATH_TYP = m.MGATH_TYP and m.MGATH_CLNT = d.MGATH_CLNT and d.MGATH_STAT = m.MGATH_STAT and m.idd.id ((trunc (m.MGATH_beg_DT) & gt; = trunc (d.MGATH_beg_DT) and trunc (m.MGATH_beg_DT) & lt;=trunc(d.MGATH_END_DT)) or (trunc (m.MGATH_END_DT) & gt; = trunc (d.MGATH_beg_DT) and trunc (m.MGATH_END_DT) & lt; = trunc (d.MGATH_END_DT)) or (trunc (m.MGATH_beg_DT) & lt; = trunc (d.MGATH_beg_DT) and trunc (m.MGATH_END_DT) & gt; = trunc (d.MGATH_END_DT))) MGATH_clnt order MGATH_beg_DT
Published by: user10727414 on March 17, 2009 01:36user10727414 wrote:
My data is correctMGSRV_CLNT = MGSRV_BEG_DT = MGSRV_END_DT
501184242 = 28-AUG-07 = 31-DEC-9999
501184242 = 28-AUG-07 = 31-DEC-9999
501184242 = 20-DEC-07 = 31-DEC-9999
501184242 = 20-DEC-07 = 31-DEC-9999And we had to guess that a year of "99" was in fact "9999" were we? Hang on I'll go and dust off my crystal ball.
Well, now we know the correct dates (?), we'll put that in the original request...
SQL> ed Wrote file afiedt.buf 1 with mypeople as 2 (select 501184242 as id, to_date('28-AUG-2007','DD-MON-YYYY') as stdt, to_date('31-DEC-9999','DD-MON-YYYY') as endt from dual union all 3 select 501184242, to_date('28-AUG-2007','DD-MON-YYYY'), to_date('31-DEC-9999','DD-MON-YYYY') from dual union all 4 select 501184242, to_date('20-DEC-2007','DD-MON-YYYY'), to_date('31-DEC-9999','DD-MON-YYYY') from dual union all 5 select 501184242, to_date('20-DEC-2007','DD-MON-YYYY'), to_date('31-DEC-9999','DD-MON-YYYY') from dual union all 6 select 2, to_date('19/01/2009','DD/MM/YYYY'), to_date('24/01/2009','DD/MM/YYYY') from dual) 7 -- END OF TEST DATA 8 select id, stdt, endt 9 ,case when lead(stdt) over (partition by id order by stdt,endt) <= endt 10 or lag(endt) over (partition by id order by stdt,endt) >= stdt then 'Overlap' 11 else 'Ok' 12 end as status 13 from mypeople 14* order by id, stdt, endt SQL> / ID STDT ENDT STATUS ---------- --------- --------- ------- 2 19-JAN-09 24-JAN-09 Ok 501184242 28-AUG-07 31-DEC-99 Overlap 501184242 28-AUG-07 31-DEC-99 Overlap 501184242 20-DEC-07 31-DEC-99 Overlap 501184242 20-DEC-07 31-DEC-99 Overlap SQL>
Looks like it works for me.
If it does not work for you then maybe had better give us a statement of create table and insert to your data in the example statements then we can see what you're trying to do.
-
OK I'm lost and sought and made changes to what I do, but not sure I correct datasets or written something wrong.
I have two date fields in my form. A Start Date and an end Date
I put a validation that indicates the Start Date/time cannot be greater than the end Date/time or so I think that's what he said. But if I put and a date in the form of an hour after the beginning of end date, it throws the error
Here are my details and maybe I'm just storing data wrong or something
Validation ENDDATE: PL/SQL error:
If to_date(:P6_DTGSTART) > to_date(:P6_DTGEND)
raise_application_error (-20001, 'End Date must be greater than the Start Date.');
end if;
When I look at the data stored in the database SQL Workshop, this is what I see
DTGSTART 11-29-2010
DTGEND
The entry in the form is a DatePicker to the format: DD-MON-YYYY HH24
If the entry as well as:
Start date/time November 29, 2010 09:25
End date/time November 29, 2010 10:25
The end date may be on the same date, but time must be greater than the start date/time
Thank you
WallyCheck it out now...
Thank you
Machaan -
can I choose the photo of the start and end positions to get rid of black borders?
I tried to use the trial version of first elements 8 before buy you to see if it's able to do what I need to.
I want to create a dvd photo, which is simple. I would like to use the scale feature to get rid of black borders and choose the start or end point of the photo. the resolution of the photos are also terrible on screen, and when I import out in an uncompressed avi file. The photos are really high resolution and are very well in other programs. Some of the photos sparkle even with anti flicker option enabled up to 100%.
Adobe first elements may be able to make a dvd photo, or should I look at another adobe program?
As Steve, pre can get you a DVD-video or a BD (for HD projects), but these will be on video and will be limited to the resolution of these two broadcast formats. If this is what you want, then the pre will do just fine.
Regarding the images, I would NOT use all (or many) on the scale. Instead, I want to resize the images to match the size of the frame of the video project in Photoshop. This ARTICLE will give you some information and some advice.
Good luck
Hunt
-
Get start and end date of week by month and year
How I need the week is here - a week always begins on a Sunday so from February, it will be
begin the week of end of week
12-02-1 02/12/04
02/12/05 02/12/11
02/12/12-02/12/18
02/12/19 02/12/25
02/12/26-29/12/29
So, because the first week does not start on a Sunday he's leaving
1 (Wednesday) to 4th (saturday) just like a calendar.
Thanks in advance
If far from Solomons help I have this
This is for January
WITH t AS)
SELECT TRUNC (TRUNC (to_date('01-01-12','MM-DD-YY'), 'YYYY')-1, 'W') + (LEVEL-1) * 7 week_start_date
OF THE DOUBLE
CONNECT BY LEVEL < = 53
)
SELECT week_start_date,
LEAST (LAST_DAY (to_date('01-01-12','MM-DD-YY')), week_start_date + 6) week_end_date
T
WHERE week_start_date > = TRUNC (to_date('01-01-12','MM-DD-YY'), 'MM')
AND week_start_date < ADD_MONTHS (TRUNC (to_date('01-01-12','MM-DD-YY'), 'MM'), 1)
begin the week of end of week
01/12/02-01/12/08
12/01/09-01/12/15
12/01/16-01/12/22
01/12/23-01/12/29
01/12/30-01/12/31If satrts Sunday of the week:
WITH t AS ( SELECT TRUNC(TRUNC(&dt,'MM') + 1,'IW') - 1 + (LEVEL - 1) * 7 week_start_date FROM DUAL CONNECT BY TRUNC(TRUNC(&dt,'MM') + 1,'IW') - 1 + (LEVEL - 1) * 7 <= LAST_DAY(&dt) ) SELECT GREATEST(week_start_date,TRUNC(&dt,'MM')) week_start_date, LEAST(LAST_DAY(&dt),week_start_date + 6) week_end_date FROM t WHERE week_start_date <= LAST_DAY(&dt) /
For example:
SQL> SET VERIFY OFF SQL> DEFINE dt="DATE '2012-01-17'" -- January SQL> WITH t AS ( 2 SELECT TRUNC(TRUNC(&dt,'MM') + 1,'IW') - 1 + (LEVEL - 1) * 7 week_start_date 3 FROM DUAL 4 CONNECT BY TRUNC(TRUNC(&dt,'MM') + 1,'IW') - 1 + (LEVEL - 1) * 7 <= LAST_DAY(&dt) 5 ) 6 SELECT GREATEST(week_start_date,TRUNC(&dt,'MM')) week_start_date, 7 LEAST(LAST_DAY(&dt),week_start_date + 6) week_end_date 8 FROM t 9 WHERE week_start_date <= LAST_DAY(&dt) 10 / WEEK_STAR WEEK_END_ --------- --------- 01-JAN-12 07-JAN-12 08-JAN-12 14-JAN-12 15-JAN-12 21-JAN-12 22-JAN-12 28-JAN-12 29-JAN-12 31-JAN-12 SQL> SET VERIFY OFF SQL> DEFINE dt="DATE '2012-02-25'" -- February SQL> WITH t AS ( 2 SELECT TRUNC(TRUNC(&dt,'MM') + 1,'IW') - 1 + (LEVEL - 1) * 7 week_start_date 3 FROM DUAL 4 CONNECT BY TRUNC(TRUNC(&dt,'MM') + 1,'IW') - 1 + (LEVEL - 1) * 7 <= LAST_DAY(&dt) 5 ) 6 SELECT GREATEST(week_start_date,TRUNC(&dt,'MM')) week_start_date, 7 LEAST(LAST_DAY(&dt),week_start_date + 6) week_end_date 8 FROM t 9 WHERE week_start_date <= LAST_DAY(&dt) 10 / WEEK_STAR WEEK_END_ --------- --------- 01-FEB-12 04-FEB-12 05-FEB-12 11-FEB-12 12-FEB-12 18-FEB-12 19-FEB-12 25-FEB-12 26-FEB-12 29-FEB-12 SQL> SET VERIFY OFF SQL> DEFINE dt="DATE '2012-03-07'" -- March SQL> WITH t AS ( 2 SELECT TRUNC(TRUNC(&dt,'MM') + 1,'IW') - 1 + (LEVEL - 1) * 7 week_start_date 3 FROM DUAL 4 CONNECT BY TRUNC(TRUNC(&dt,'MM') + 1,'IW') - 1 + (LEVEL - 1) * 7 <= LAST_DAY(&dt) 5 ) 6 SELECT GREATEST(week_start_date,TRUNC(&dt,'MM')) week_start_date, 7 LEAST(LAST_DAY(&dt),week_start_date + 6) week_end_date 8 FROM t 9 WHERE week_start_date <= LAST_DAY(&dt) 10 / WEEK_STAR WEEK_END_ --------- --------- 01-MAR-12 03-MAR-12 04-MAR-12 10-MAR-12 11-MAR-12 17-MAR-12 18-MAR-12 24-MAR-12 25-MAR-12 31-MAR-12 SQL>
SY.
Published by: Solomon Yakobson, January 12, 2012 13:19
-
Hello
I have an obligation to make the fiscal quarters following the date of beginning and end given.
For example if I have
start date: 1 January 09
end date: 31 December 09
I divide it into 4 quarters as below:
T1: 1 January 09-31 March 09
Qtr2: 1 April 09-30 June 09
Qtr3: 1 July 09-30 September 09
Qtr4: 1st October 09-31 December 09
Help, please.
Kind regards
FahimHello
SQL> SELECT ADD_MONTHS(to_date('01-JAN-2008','DD-MON-YYYY'),(ROWNUM-1)*3) start_dt,(ADD_MONTHS(to_date('01-JAN-2008','DD-MON-YYYY'),ROWNUM*3))-1 End_Date 2 FROM DUAL 3 CONNECT BY ADD_MONTHS(to_date('01-JAN-2008','DD-MON-YYYY'),(LEVEL-1)*3) <=to_date('30-SEP-2009','DD-MON-YYYY'); START_DT END_DATE --------- --------- 01-JAN-08 31-MAR-08 01-APR-08 30-JUN-08 01-JUL-08 30-SEP-08 01-OCT-08 31-DEC-08 01-JAN-09 31-MAR-09 01-APR-09 30-JUN-09 01-JUL-09 30-SEP-09 7 rows selected. SQL>
See you soon,.
-
Alternate greeting - start and end date
We have 8.6 connection of the unit. I know alternate greetings may have end dates, but our users also want the start dates. Is this possible? I have not seen it mentioned anywhere, but I thought I would check before giving up on this subject.
Unfortunately not.
Chris
-
Start and end date of week 1-5 a month
I wanted to print the date of beginning and end of the week for a given month. If the month last_week overlaps the next month, I don't want to print the week5. If the week5 overlap with next month, then it must be printed.
SELECT
TRUNC (to_date(:P_DATE,'MM/DD/YYYY'), 'IW') 'SW1', / * start of week 1 * /.
TRUNC (TO_DATE (: P_DATE, "MM/DD/YYYY '") + 6, 'IW')-1 'EW1', / * end of week you 1 * /.
NEXT_DAY (trunc (to_date(:P_DATE,'MM/DD/YYYY'), 'IW'), 'Monday') 'SW2 '.
NEXT_DAY (TRUNC (TO_DATE (: P_DATE, "MM/DD/YYYY") + 6, 'IW'), 'Sunday') 'EW2. "
NEXT_DAY (NEXT_DAY (trunc (to_date(:P_DATE,'MM/DD/YYYY'), 'IW'), 'Monday'), 'Monday') "SW3."
NEXT_DAY (NEXT_DAY (TRUNC (TO_DATE (: P_DATE, "MM/DD/YYYY") + 6, 'IW'), 'Sunday'), 'Sunday') 'EW3. "
NEXT_DAY (NEXT_DAY (NEXT_DAY (trunc (to_date(:P_DATE,'MM/DD/YYYY'), 'IW'), 'Monday'), 'Monday'), 'Monday') "SW4".
NEXT_DAY (NEXT_DAY (NEXT_DAY (TRUNC (TO_DATE (: P_DATE, "MM/DD/YYYY") + 6, 'IW'), 'Sunday'), 'Sunday'), 'Sunday') 'EW4. "
NEXT_DAY (NEXT_DAY (NEXT_DAY (NEXT_DAY (trunc (to_date(:P_DATE,'MM/DD/YYYY'), 'IW'), 'Monday'), 'Monday'), 'Monday'), 'Monday') 'SW5. "
NEXT_DAY (NEXT_DAY (NEXT_DAY (NEXT_DAY (TRUNC (TO_DATE (: P_DATE, "MM/DD/YYYY") + 6, 'IW'), 'Sunday'), 'Sunday'), 'Sunday'), 'Sunday') 'EW5.
FROM DUAL;
SW1 EW1 SW2 EW2 SW3 EW3 SW4 EW4 SW5 EW5 29/12/2014 04/01/2015 05/01/2015 11/01/2015 12/01/2015 18/01/2015 19/01/2015 25/01/2015 26/01/2015 01/02/2015 Is it possible to get it without using the next_day() several times for each week and to limit the accumulation of the week last in a month.
Check my last answer. And if this isn't what you need, then the expected results for each month in 2015.
SY.
-
Set the start and end of a graph
Hello
I already searched the topic but have not found an answer. I'm a newbie to LabWindows.
I write an application. For the application, there is a graph that shows a signal, axis is-> voltage and x-> time axis. By default the signal starts with the value 0 in the time axis. But my signal does not begin with 0. I would change the start value and the value of the end of the shaft manually. Does anyone know how it works (between AutoScaling)?
I have also two x-axis in my chart. I put them with the offset (10 v and the other to-10V), but I would like to have two x axis starting with the 0 value in different heights. Is it possible to implement who?
Best regards
-
REGEXP_REPLACE remove the start and end quotes.
Hello guys,.
I have a problem with my regular expression and I hope someone can help me with this?
Imagine the following sample_data:
{code}
WITH sample_data AS
(
SELECT "'[email protected] "' double UNION ALL e
SELECT "'[email protected] ' double UNION ALL e
SELECT ' [email protected] "' double UNION ALL e
SELECT "'[email protected] "' double UNION ALL e
SELECT ' [email protected] "' double UNION ALL e
SELECT "'[email protected] ' like e dual FROM
)
SELECT e, REGEXP_REPLACE (e, '(^'')? (. *) (''$)', '\2')
OF sample_data;
{code}
I would like to remove all the quotes of beginning and end of the email. I made previous regexp, but she does not return the correct result. I know not why, but for some reason, when my email ends with a quote, the main quotation is not deleted.
Can someone help me with this?
Thank you
Another solution...
WITH sample_data AS (SELECT '''[email protected]''' AS e FROM DUAL UNION ALL SELECT '''[email protected]' AS e FROM DUAL UNION ALL SELECT '[email protected]''' AS e FROM DUAL UNION ALL SELECT '''[email protected]''''' AS e FROM DUAL UNION ALL SELECT '[email protected]''' AS e FROM DUAL UNION ALL SELECT '''''[email protected]' AS e FROM DUAL) SELECT e, REGEXP_REPLACE (e, '(^''+)|(''+$)') FROM sample_data
Maybe you are looking for
-
my iphone 6 when connected to speakers or headphones works well and the person on the other side can hear me clearly. but when it is without headphones or speakers is in normal mode, the voice is barely crosses to the other person. Please suggest an
-
missing a next button in <; input type = "number" >;
Hello, I use a Nexus 7 (2013). The button 'next' - to navigate to the next entry - not is not on the virtual keyboard when < input > type is set to number. Even if it is shown for the types of 'text' and 'such '. Am I missing something?
-
Connection U800W and projector to satellite
I have a Toshiba Satellite U800W of China. And I would like to know if there is a port of the projector cable. I'm a student and my school uses a projector to show our reports. So please let me know. Thank you.
-
Photos from Apple does not open
Photos from Apple does not open on the slider.
-
Dell tech told me that the reason for my screen was sgretched was a bad reader video-how can I fix? I deleted ALL my drivers monitor now