get the first and last day of the year
and razm.date > = to_date ("' 1.01 ' |: $VDATE |", ' dd.mm.yyyy ") AND razm.date < = to_date ('31.12.2010. ' || (": $VDATE |", ' dd.mm.yyyy ");but I get:
ORA-01830: date format picture ends before converting all of the input string
01830 00000 - "date format picture ends before converting all of the input string.
* Cause:
* Action:
: $VDATE is entered as 2010 param. I need to get data from range 1.1.2001 to 31.12.2010
THX
Why don't you use:
to_char(razm.date,'YYYY') = :VDATE
Tags: Database
Similar Questions
-
Hello people:
I have currently a query that picks up all the weeks between a date range where my week starts on Thursday and ends on Wednesday. The following query works fine except that I need the week of beginning and end, from beginning and end Dates of months and the beginning and the Dates of end of the values of the settings, I'm passing. In this case, I chose January 1, 2013 to 31 December 2013.
Any help or pointers would be great!
Thank you!
Problem: I am picking up days of December 2012 as the first week began on December 27, 2012. In addition, in December, I'm pretty much lost last week as well (26 December - 31 December).
The request in hand:
SELECT first_thursday + (7 * (LEVEL - 1)) AS week_start_date, first_thursday + (7 * LEVEL) - 1 AS week_end_date FROM ( SELECT TRUNC(p_from_date + 4, 'IW') - 4 AS first_thursday, -- Week should start the pre ceeding THURSDAY based on the Start Date TRUNC( p_to_date + 4, 'IW') - 5 AS last_wednesday FROM ( SELECT to_date('01-JAN-2013') AS p_from_date, NVL(to_date('31-DEC-2013'), SYSDATE) AS p_to_date FROM dual ) parms ) end_points CONNECT BY LEVEL <= ( last_wednesday + 1 - first_thursday)/7;
Currently, this is the result I get (I'm only including the months of January and December here).
Week_Start_Date Week_End_Date 27-DEC-12 02-JAN-13 03-JAN-13 09-JAN-13 10-JAN-13 16-JAN-13 17-JAN-13 23-JAN-13 24-JAN-13 30-JAN-13 31-JAN-13 06-FEB-13
December:
28-NOV-13 04-DEC-13 05-DEC-13 11-DEC-13 12-DEC-13 18-DEC-13 19-DEC-13 25-DEC-13
What I would really like is based on start and end Dates, as well as the first and the last day of the month is similarly try nicely. I have provided and then gently break at the end of the month:
January:
01-JAN-13 02-JAN-13 03-JAN-13 09-JAN-13 10-JAN-13 16-JAN-13 17-JAN-13 23-JAN-13 24-JAN-13 30-JAN-13 31-JAN-13 31-JAN-13
February:
01-FEB-13 06-FEB-13 07-FEB-13 13-FEB-13 14-FEB-13 20-FEB-13 21-FEB-13 27-FEB-13 28-FEB-13 28-FEB-13
November:
31-OCT-13 06-NOV-13 07-NOV-13 13-NOV-13 14-NOV-13 20-NOV-13 21-NOV-13 27-NOV-13 28-NOV-13 04-DEC-13
December:
01-DEC-13 04-DEC-13 05-DEC-13 11-DEC-13 12-DEC-13 18-DEC-13 19-DEC-13 25-DEC-13 26-DEC-13 31-DEC-13
Hello
Roxyrollers wrote:
Hello people:
I have currently a query that picks up all the weeks between a date range where my week starts on Thursday and ends on Wednesday. The following query works fine except that I need the week of beginning and end, from beginning and end Dates of months and the beginning and the Dates of end of the values of the settings, I'm passing. In this case, I chose January 1, 2013 to 31 December 2013.
Any help or pointers would be great!
Thank you!
Problem: I am picking up days of December 2012 as the first week began on December 27, 2012. In addition, in December, I'm pretty much lost last week as well (26 December - 31 December).
The request in hand:
- First_thursday SELECT + (7 * (LEVEL - 1)) AS week_start_date,
- first_thursday + (7 * LEVEL)-1 AS week_end_date
- Of
- (
- SELECT TRUNC (p_from_date + 4, 'IW') - 4 AS first_thursday,-week should start to perform the pre-mounted THURSDAY based on the Start Date
- TRUNC (p_to_date + 4, 'IW') - 5 AS last_wednesday
- Of
- (
- SELECT to_date('01-JAN-2013') AS p_from_date,
- NVL (to_date('31-Dec-2013'), SYSDATE) AS p_to_date
- OF the double
- ) parms
- ) end_points
- CONNECT BY LEVEL<= (="" last_wednesday="" +="" 1="" -="">=>
Currently, this is the result I get (I'm only including the months of January and December here).
- Week_Start_Date Week_End_Date
- DECEMBER 27, 12 2 JANUARY 13
- JANUARY 3, 13 JANUARY 9, 13
- 10 JANUARY 13 JANUARY 16, 13
- 17 JANUARY 13 23 JANUARY 13
- 24 JANUARY 13 30 JANUARY 13
- 31 JANUARY 13 FEBRUARY 6, 13
December:
- NOVEMBER 28, 13 4 DECEMBER 13
- 5 DECEMBER 13 DECEMBER 11, 13
- 12 DECEMBER 13 18 DECEMBER 13
- 19 DECEMBER 13 DECEMBER 25, 13
What I would really like is based on start and end Dates, as well as the first and the last day of the month is similarly try nicely. I have provided and then gently break at the end of the month:
January:
- JANUARY 1, 13 2 JANUARY 13
- JANUARY 3, 13 JANUARY 9, 13
- 10 JANUARY 13 JANUARY 16, 13
- 17 JANUARY 13 23 JANUARY 13
- 24 JANUARY 13 30 JANUARY 13
- 31 JANUARY 13 JANUARY 31, 13
February:
- 1ST FEBRUARY 13 FEBRUARY 6, 13
- 7 FEBRUARY 13 FEBRUARY 13, 13
- 14 FEBRUARY 13 FEBRUARY 20, 13
- 21 FEBRUARY 13 FEBRUARY 27, 13
- 28 FEBRUARY 13 FEBRUARY 28, 13
November:
- 31 OCTOBER 13 NOVEMBER 6, 13
- 7 NOVEMBER 13 NOVEMBER 13, 13
- 14 NOVEMBER 13 NOVEMBER 20, 13
- 21 NOVEMBER 13 NOVEMBER 27, 13
- NOVEMBER 28, 13 4 DECEMBER 13
December:
- 1ST DECEMBER 13 DECEMBER 4, 13
- 5 DECEMBER 13 DECEMBER 11, 13
- 12 DECEMBER 13 18 DECEMBER 13
- 19 DECEMBER 13 DECEMBER 25, 13
- 26 DECEMBER 13 DECEMBER 31, 13
Why the "weeks" in November, have all 7 days, while the "weeks" in the first or the last week in the other month usually have less? (For example, February 28 is a 'week' alone.)
The following works for the other months:
WITH all_days AS
(
SELECT DATE "2013-01-01' + LEVEL - AS a_date 1
OF the double
CONNECT BY LEVEL<=>=>
)
SELECT DISTINCT
More GRAND (TRUNC (a_date + 4, 'IW') - 4)
, TRUNC (a_date, 'MONTH')
) AS week_begin
, The LEAST (TRUNC (a_date + 4, 'IW') + 2
TRUNC (LAST_DAY (a_date))
), Week_end
Of all_days
ORDER BY week_begin
;
Output:
WEEK_BEGIN WEEK_END
----------- -----------
January 1, 2013 January 2, 2013
January 3, 2013 January 9, 2013
January 10, 2013 January 16, 2013
January 17, 2013 January 23, 2013
January 24, 2013 January 30, 2013
January 31, 2013 January 31, 2013
February 1, 2013 February 6, 2013
February 7, 2013 February 13, 2013
February 14, 2013 February 20, 2013
February 21, 2013 February 27, 2013
February 28, 2013 February 28, 2013
...
November 1, 2013 November 6, 2013
November 7, 2013 November 13, 2013
November 14, 2013 November 20, 2013
November 21, 2013 November 27, 2013
November 28, 2013 November 30, 2013
December 1, 2013 December 4, 2013
December 5, 2013 December 11, 2013
December 12, 2013 December 18, 2013
December 19, 2013 December 25, 2013
26 December 2013 31 December 2013
-
request for return 2nd motnh first and last day
Any body please give me the query back 2 months first day after the 2nd month last day?
last month first day
TIMESTAMPADD (SQL_TSI_MONTH-1, TIMESTAMPADD (SQL_TSI_DAY,-(DAY (CURRENT_DATE)-1), CURRENT_DATE))
last month last day
TIMESTAMPADD (SQL_TSI_DAY,-(DAY (CURRENT_DATE)), CURRENT_DATE)
someone I care please months as above queries queries?
2nd month back day -?
2nd back months last day -?
3rd month back day -?
3rd month back last - day?Hello
2nd month back day -?
TIMESTAMPADD (SQL_TSI_MONTH,-2, TIMESTAMPADD (SQL_TSI_DAY,-(DAY (CURRENT_DATE)-1), CURRENT_DATE))
2nd back months last day -?
TIMESTAMPADD (SQL_TSI_MONTH-1, TIMESTAMPADD (SQL_TSI_DAY,-(DAY (CURRENT_DATE)), CURRENT_DATE))
3rd month back day -?
TIMESTAMPADD (SQL_TSI_MONTH,-3, TIMESTAMPADD (SQL_TSI_DAY,-(DAY (CURRENT_DATE)-1), CURRENT_DATE))
3rd month back last - day?
TIMESTAMPADD (SQL_TSI_MONTH,-2, TIMESTAMPADD (SQL_TSI_DAY,-(DAY (CURRENT_DATE)), CURRENT_DATE))
Kind regards
Srikanth -
Need a query to return the first and last date for a rowset.
Hello
I have a query which can be simplified to the following data, if
Assume that it is my dataset, with THE_VALUE of
Sign (Anum) therefore,-1, 0 or 1.
* (Sorry for crushed registration. "I can't understand this website's rich text formatting.) *
THE_VALUE THE_DATE THE_MEMBER
1 0 1 January 2007
1 0 1 February 2007
1 0 1 March 2007
1. 1 April 1, 2007
1 1 1 May 2007
1 0 1 June 2007
1. 1 July 1, 2007
1. 1 August 1, 2007
1 0 01 - sep - 2007
2 0 1 January 2007
2 1 February 1, 2007
2 0 1 March 2007
2. 1 April 1, 2007
2 1 1 May 2007
2 0 1 June 2007
-2 1 1 July 2007
2. 1 August 1, 2007
2. 1 01-sep-2007
3 0 1 January 2007
3. 1 February 1, 2007
3 0 1 March 2007
3 0 1 April 2007
3. 1 May 1, 2007
3 0 1 June 2007
3. 1 July 1, 2007
3. 1 August 1, 2007
3 0 01 - sep - 2007
I need to get the lines with the THE_MEMBER, the values of the first and the last
THE_DATE, where the value is - 1, and the date range is the last
set of lines to the Member, with the same value of THE_VALUE.
I tried the following to get the dates of first and last for a set
consecutive months with the same value for the Member.
SELECT the_member
the_value
the_date
first_value (the_date)
in the first_date (PARTITION the_member, ORDER BY the_member the_value, the_date)
last_value (the_date)
during the last_date (PARTITION the_member, ORDER BY the_member the_value, the_date)
OF togola
ORDER BY the_member
the_date;
At first, it seems to work, but then, when the return value
an old value, FIRST_DATE will be the first of all the lines containing
This value for the Member rather than the first of consecutive
rows with this value for the Member. Apparently the partitioning
occurs before the order.
THE_MEMBER THE_VALUE THE_DATE FIRST DATE LAST DATE
1 0 January 1, 2007 January 1, 2007 January 1, 2007
1 0 1 February 2007 1 January 2007 1 February 2007
1 0 1 March 2007 1 January 2007 March 1, 2007
1. 1 April 1, 2007 April 1, 2007 April 1, 2007
1. 1 May 1, 2007 April 1, 2007 may 1, 2007
1-0 June 1, 2007 January 1, 2007 June 1, 2007
1. 1 July 1, 2007 April 1, 2007 July 1, 2007
1. 1 August 1, 2007 April 1, 2007 August 1, 2007
1 0 01 - sep - 2007 1 January 2007 01-Sep-2007
2 0 January 1, 2007 January 1, 2007 January 1, 2007
2 1 1 February 2007 February 1, 2007 February 1, 2007
2 0 1 March 2007 1 January 2007 March 1, 2007
2. 1 April 1, 2007 February 1, 2007 April 1, 2007
2 1 1 May 2007 February 1, 2007 may 1, 2007
2-0 June 1, 2007 January 1, 2007 June 1, 2007
-2 1 1 July 2007 February 1, 2007 July 1, 2007
2. 1 August 1, 2007 February 1, 2007 August 1, 2007
2. 1 01-sep-2007 1 February 2007 01-Sep-2007
3 0 January 1, 2007 January 1, 2007 January 1, 2007
3. 1 February 1, 2007 February 1, 2007 February 1, 2007
3 0 1 March 2007 1 January 2007 March 1, 2007
3 0 April 1, 2007 January 1, 2007 April 1, 2007
3. 1 May 1, 2007 February 1, 2007 may 1, 2007
3 0 June 1, 2007 January 1, 2007 June 1, 2007
3. 1 July 1, 2007 February 1, 2007 July 1, 2007
3. 1 August 1, 2007 February 1, 2007 August 1, 2007
3 0 01 - sep - 2007 1 January 2007 01-Sep-2007
That's what I need to get in the end.
THE_MEMBER FIRST DAY DATE OF LAST
July 2 1 2007-01 - Sep - 2007
Any ideas would be really appreciated.
Published by: user10700981 on December 17, 2008 13:57Hello
We'll call the lines whose the_value =-1 'good' lines and lines with the_value! =-1 ranks of 'bad '.
For each value of the_value, we need the first and last values of the_date where
the last row in the group is good
(b) the current line is good
(c) there is a lot of lines from the current line to the end of the Group
Condition (a) is just a special case of (c).
Conditions (b) and (c) are similar: (b) if applied to the current line, (c) applies to all lines after him. They can easily be combined into a single test that counts the number of lines after the current line or bad.Which produces the results you requested of the sample data that you provided:
WITH count_bad AS ( SELECT the_member , the_date , COUNT ( CASE WHEN the_value != -1 -- assuming the_value is never NULL THEN 1 END ) OVER ( PARTITION BY the_member ORDER BY the_date DESC ) AS bad_cnt FROM table_x ) SELECT the_member , MIN (the_date) AS first_date , MAX (the_date) AS last_date FROM count_bad WHERE bad_cnt = 0 GROUP BY the_member ORDER BY the_member;
-
Impossible to print the first and last pages of a pdf of the 8 page?
I have a pdf of 8 pages exported from an InDesign document. I can print it without any problem on my MAC, but when I will forward it to a partner, she is unable to print the first and last pages. Any ideas?
Could you please let us know the version of Adobe Reader is installed on the machine?
What operating system is installed on the machine-Windows/Mac?
The pdf is printing via a network printer?
This phenomenon happens with a specific document only or with other documents as well?
Try to print the pdf as image, launch Adobe Reader, click Print > select your printer from the drop-down > click on advanced > check the print as Image > and then click OK.
Let us know if it worked.
Thank you
Shivam
-
I would like to change the name in my profile my name and my company name, so when my clients receive a signature on the Forms application, my company name is displayed in the email as opposed to my first and last name. How can I change this? I tried to edit my profile however my first and last name are not editable fields.
Hello Laurag92400722,
You connect with Adobe ID account E-Sign? If Yes, then you can directly connect to your Adobe ID account and can update the name as the name of the company and it will reflect in your E-Sign account as well.
-Usman
-
Hi, when you cut a clip using the standard cursor (not the adjustment tool but just the mouse), the behavior that I was accustomed to is it shows the first and last frame of the clip you're carved, in a 2 - up window. Now in the updated 2015 I'm confused because it's still place 2 window, but instead I see the head or tail of any clip is next to any side of the clip, I'm trying to cut. I can see the utility in this, but I would like to know where I can go to the screen more as I'm used to it...
Thank you!
Click on the key in the timeline and in the drop-down the menu uncheck Composite overview over the filling.
MtD
-
Can only see the first and last frame of the item in the editing HELP PLEASE
Hi, my first time and I find an answer, but fails. I first elements 4 and I'm trying to worm. 9. in version 4 clips in the timelin shows all the frames, but in ver 9 it only shows the first and last frame clips. Is it possible to make all the images to display. I mean by "all frames", clips from filling with frames. I wanted to see all of the images in the scenario, it is easier for me to select and cut the pieces on.
My features are Core 2 Duo 6750, Nvidia 8600GTS, 4 G of Ram and Vista Home Premium. 3 HARD DRIVE 3 TB.
Thank you for having responded
Werner
Werner,
Welcome to the forum.
In the header of the video track, there is an icon for Clip thumbnail display. It's a cycle, and you can scroll through the Modes to display the first frame, first & last, all, or none (name of file only). In pre 4.0, it's on the far left in the header of the track. I guess that's about the same place in pre 9.0.
Good luck and hope that helps.
Hunt
-
Detect the first and last spark of list items
Hello
I have a converter item personalized with a background image for each item in a list. the thing is I'm trying to have a different background for the first and last elements (curved respectively) and I don't know how to do this.
Any help will be appreciated.
not sure it's the best solution, but:
You can override the method to data defined in your itemRenderer. Compare the new data for the first and last items in your list. And you set the background depending on the result.
-
First and last &; functions
Hello
Can someone give me a brief description of the functions of first and last in sql. If you can explain with an example... It is very useful.
Concerning
ARHello
Check this box... Hope this will help you
First and Last: *********** The FIRST and LAST functions can be used to return the first or last value from an ordered sequence. Say we want to display the salary of each employee, along with the lowest and highest within their department we may use something like: SELECT deptno, ename, sal, MIN(sal) KEEP (DENSE_RANK FIRST ORDER BY sal) OVER (PARTITION BY deptno) "Lowest", MAX(sal) KEEP (DENSE_RANK LAST ORDER BY sal) OVER (PARTITION BY deptno) "Highest" FROM emp ORDER BY deptno, sal; DEPTNO ENAME SAL Lowest Highest ---------- ---------- ---------- ---------- ---------- 10 MILLER 1300 1300 5000 10 CLARK 2450 1300 5000 10 KING 5000 1300 5000 20 SMITH 800 800 3000 20 ADAMS 1100 800 3000 20 JONES 2975 800 3000 20 SCOTT 3000 800 3000 20 FORD 3000 800 3000 30 JAMES 950 950 2850 30 WARD 1250 950 2850 30 MARTIN 1250 950 2850 30 TURNER 1500 950 2850 30 ALLEN 1600 950 2850 30 BLAKE 2850 950 2850
KPR
-
original title: facilities program
During ANY installation of a program (e.g. Skype), I get the "year error occurred while attempting to create the directory C:\Program\Microsoft\Windows\Start Menu. What happened with cd installs, but also downloads on the internet. I already "took possession" of the computer, which is still delayed freaking, but am still unable to fight through all the questions of security, I guess that. Any help would be greatly appreciated as I'm about to DOWNGRADE to something more user-friendly. Thank you
BTW, this is WINDOWS 7 Home Premium
I had this problem for a long time on Windows 7. Finally, by pure chance I came across this solution that solved the problem. -Take the shortcut of the property
http://www.SevenForums.com/tutorials/1911-take-ownership-shortcut.html
You will need to run the "fusion" in the context menu of a reg file, published as part of the solution to change some registry settings. On any folder, you'll get a context menu 'Take Ownership' which restores the property correctly. This solves a lot of problems installing.
Many people have trouble with this and therefore decided to post here.
Gem of a solution. Thanks to GRIM and Brink on Windows 7 Forum!
-Jayawanth
-
How to get the first and last record
Hai All
I have a table called T1 and there are more than 8 lakhs Archives and I have a column named Timestamp, so I need to get the first record value and time stampvalue and last record and time stamp value so that I can conclude that for example
form June 13 to 15 June data are here
Kind regards
SrikkanthMWhat is the problem with:
select min(timestamp),max(timestamp) from T1;
?
-
To display the first and last date of one month
I have the date format in 10 Mar 10.
My requirement is when ever I select the date in the dashboard for all the month it should show results of all the months.
I had the request for obiee101.blogspot.com.but if I use that sometimes it is not the latest results of the day. Any body please give me the query to display the results for the first day and lastday?
I select any day from the drop-down menu of the guest, it must display the month of ex: if results
If I select either 1 mar mar 10.2 10,30 mar 10...
It should give results for the month of March.
Can you please provide me the query for the last month also?
If I select March date date print want to display the results of March together in a single column, results of the previous months in the other column
Someone help me to achieve this?Yes, you are right. Jean SQL for the last day of the month, if the "last day of the previous month" ends on June 30, that "adding a month" will result in the 30th of the following month. But if the next month has 31 days, you don't miss this day here.
Use it for the last day of the current month.
TIMESTAMPADD (SQL_TSI_DAY-1, TIMESTAMPADD (SQL_TSI_MONTH, 1, TIMESTAMPADD (SQL_TSI_DAY, 1, TIMESTAMPADD (SQL_TSI_DAY, DAYOFMONTH (CURRENT_DATE) *-1, CURRENT_DATE))))
The SQL above will ensure that you will get always the last day of the month "current" no matter how many days during the previous or current month.
-
Find the first and last record in a game and the calculation of time
I have the following table and data below,
CREATE TABLE AAA_CDR
(ACCTTYPE (1) NUMBER, MSID VARCHAR2(20 BYTE), ACCOUNTSESSION_ID VARCHAR2(64 BYTE), BEGINNINGSESSION NUMBER (1),)
SESSIONCONTINUE NUMBER (1), ACCT_MULTI_SESSION_ID VARCHAR2(64 BYTE), DATAOCTETCOUNTORIGINATING NUMBER (20), DATAOCTETCOUNTTERMINATING NUMBER (20), ACCTSESSIONTIME NUMBER (20));
-SQL statement that produces these data:
/ * Select msid, accountsession_id, beginningsession, sessioncontinue, ACCTTYPE, acct_multi_session_id,.
dataoctetcountoriginating, dataoctetcountterminating, acctsessiontime
OF AAA_CDR
where msid = "5C4CA98EAC4C."
ORDER BY acct_multi_session_id, accountsession_id, accttype
*/
Insert into AAA_CDR (ACCTTYPE, MSID, ACCOUNTSESSION_ID, BEGINNINGSESSION, SESSIONCONTINUE, ACCT_MULTI_SESSION_ID, DATAOCTETCOUNTORIGINATING, DATAOCTETCOUNTTERMINATING, ACCTSESSIONTIME)
Values (1, '5C4CA98EAC4C', '190001E9', 1, 0, '100014E19775F169', 0, 0, 0);
Insert into AAA_CDR (ACCTTYPE, MSID, ACCOUNTSESSION_ID, BEGINNINGSESSION, SESSIONCONTINUE, ACCT_MULTI_SESSION_ID, DATAOCTETCOUNTORIGINATING, DATAOCTETCOUNTTERMINATING, ACCTSESSIONTIME)
Values (2, '5C4CA98EAC4C', '190001E9', 0, 0, '100014E19775F169', 47496, 182054, 70);
Insert into AAA_CDR (ACCTTYPE, MSID, ACCOUNTSESSION_ID, BEGINNINGSESSION, SESSIONCONTINUE, ACCT_MULTI_SESSION_ID, DATAOCTETCOUNTORIGINATING, DATAOCTETCOUNTTERMINATING, ACCTSESSIONTIME)
Values (1, '5C4CA98EAC4C', ' 290001C 4', 1, 0, '100014E19E21F16C', 0, 0, 0);
Insert into AAA_CDR (ACCTTYPE, MSID, ACCOUNTSESSION_ID, BEGINNINGSESSION, SESSIONCONTINUE, ACCT_MULTI_SESSION_ID, DATAOCTETCOUNTORIGINATING, DATAOCTETCOUNTTERMINATING, ACCTSESSIONTIME)
Values (2, '5C4CA98EAC4C', ' 290001C 4', 0, 0, '100014E19E21F16C', 3278162, 17540714, 14152);
Insert into AAA_CDR (ACCTTYPE, MSID, ACCOUNTSESSION_ID, BEGINNINGSESSION, SESSIONCONTINUE, ACCT_MULTI_SESSION_ID, DATAOCTETCOUNTORIGINATING, DATAOCTETCOUNTTERMINATING, ACCTSESSIONTIME)
Values (1, '5C4CA98EAC4C', 190001 FC', 1, 0, '100014E1A949316E', 0, 0, 0);
Insert into AAA_CDR (ACCTTYPE, MSID, ACCOUNTSESSION_ID, BEGINNINGSESSION, SESSIONCONTINUE, ACCT_MULTI_SESSION_ID, DATAOCTETCOUNTORIGINATING, DATAOCTETCOUNTTERMINATING, ACCTSESSIONTIME)
Values (2, '5C4CA98EAC4C', 190001 FC', 0, 1, "100014E1A949316E", 682734, 2935111, 1553);
Insert into AAA_CDR (ACCTTYPE, MSID, ACCOUNTSESSION_ID, BEGINNINGSESSION, SESSIONCONTINUE, ACCT_MULTI_SESSION_ID, DATAOCTETCOUNTORIGINATING, DATAOCTETCOUNTTERMINATING, ACCTSESSIONTIME)
Values (1, '5C4CA98EAC4C', '190001FD', 0, 0, '100014E1A949316E', 0, 0, 0);
Insert into AAA_CDR (ACCTTYPE, MSID, ACCOUNTSESSION_ID, BEGINNINGSESSION, SESSIONCONTINUE, ACCT_MULTI_SESSION_ID, DATAOCTETCOUNTORIGINATING, DATAOCTETCOUNTTERMINATING, ACCTSESSIONTIME)
Values (2, '5C4CA98EAC4C', '190001FD', 0, 1, "100014E1A949316E", 1821052, 9585090, 5368);
Insert into AAA_CDR (ACCTTYPE, MSID, ACCOUNTSESSION_ID, BEGINNINGSESSION, SESSIONCONTINUE, ACCT_MULTI_SESSION_ID, DATAOCTETCOUNTORIGINATING, DATAOCTETCOUNTTERMINATING, ACCTSESSIONTIME)
Values (1, '5C4CA98EAC4C', '190001FE', 0, 0, '100014E1A949316E', 0, 0, 0);
Insert into AAA_CDR (ACCTTYPE, MSID, ACCOUNTSESSION_ID, BEGINNINGSESSION, SESSIONCONTINUE, ACCT_MULTI_SESSION_ID, DATAOCTETCOUNTORIGINATING, DATAOCTETCOUNTTERMINATING, ACCTSESSIONTIME)
Values (2, '5C4CA98EAC4C', '190001FE', 0, 1, "100014E1A949316E", 42012, 505004, 213);
Insert into AAA_CDR (ACCTTYPE, MSID, ACCOUNTSESSION_ID, BEGINNINGSESSION, SESSIONCONTINUE, ACCT_MULTI_SESSION_ID, DATAOCTETCOUNTORIGINATING, DATAOCTETCOUNTTERMINATING, ACCTSESSIONTIME)
Values (1, '5C4CA98EAC4C', '19000200', 0, 0, '100014E1A949316E', 0, 0, 0);
Insert into AAA_CDR (ACCTTYPE, MSID, ACCOUNTSESSION_ID, BEGINNINGSESSION, SESSIONCONTINUE, ACCT_MULTI_SESSION_ID, DATAOCTETCOUNTORIGINATING, DATAOCTETCOUNTTERMINATING, ACCTSESSIONTIME)
Values (2, '5C4CA98EAC4C', 0, '19000200', 1, '100014E1A949316E', 50224, 144566, 729).
Insert into AAA_CDR (ACCTTYPE, MSID, ACCOUNTSESSION_ID, BEGINNINGSESSION, SESSIONCONTINUE, ACCT_MULTI_SESSION_ID, DATAOCTETCOUNTORIGINATING, DATAOCTETCOUNTTERMINATING, ACCTSESSIONTIME)
Values (1, '5C4CA98EAC4C', '19000201', 0, 0, '100014E1A949316E', 0, 0, 0);
Insert into AAA_CDR (ACCTTYPE, MSID, ACCOUNTSESSION_ID, BEGINNINGSESSION, SESSIONCONTINUE, ACCT_MULTI_SESSION_ID, DATAOCTETCOUNTORIGINATING, DATAOCTETCOUNTTERMINATING, ACCTSESSIONTIME)
Values (2, '5C4CA98EAC4C', 0, '19000201', 1, '100014E1A949316E', 62634, 378416, 392);
Insert into AAA_CDR (ACCTTYPE, MSID, ACCOUNTSESSION_ID, BEGINNINGSESSION, SESSIONCONTINUE, ACCT_MULTI_SESSION_ID, DATAOCTETCOUNTORIGINATING, DATAOCTETCOUNTTERMINATING, ACCTSESSIONTIME)
Values (1, '5C4CA98EAC4C', '19000202', 0, 0, '100014E1A949316E', 0, 0, 0);
Insert into AAA_CDR (ACCTTYPE, MSID, ACCOUNTSESSION_ID, BEGINNINGSESSION, SESSIONCONTINUE, ACCT_MULTI_SESSION_ID, DATAOCTETCOUNTORIGINATING, DATAOCTETCOUNTTERMINATING, ACCTSESSIONTIME)
Values (2, '5C4CA98EAC4C', '19000202', 0, 0, '100014E1A949316E', 1457286, 9141033, 7574);
commit;
I need to calculate the sum (dataeoctetcountoriginating) + sum (dataoctetcountterminating) for each session
It is average, but the beginning of the session and the end of the session, as below,
for each ACCT_MULTI_SESSION_ID and MSID
the beginning of the session is when the accttype = 1 and beginningsession = 1
and the end of the session is at this time the accttype = 2 and SESSIONCONTINUE = 0
1. collect the first accounting start CDR generated an event online for a user.
Collect CDR AcctType is 1 and beginning of Session is 1 according to MSID. In
also, see the value of the Acct-Multi-Session-ID field in the CDR.
2. collect all Accountants stop CDRs generated during this event the user online.
Collect CDR AcctType is 2 according to MSID and Acct-Multi-Session-ID.
If the value of Session continues on a CD - r accounting stop is 0, it indicates that this CDR
is the last CDR of accounting judgment that is generated during the event of the user's offline.
3. calculate the total volume of the user during this event online.
Add the values of the data fields Byte Count (termination) and data values
Fields byte (native) Count in the accounts collected stop CDRs together to get
the total volume of this event the user online.
How can I find each session, then calculate the sum of this session?
any help please
Published by: user11309581 on July 13, 2011 22:01Is that what you are looking for:
select acct_multi_session_id, max(ACCTSESSIONTIME)-min(ACCTSESSIONTIME) from AAA_CDR group by acct_multi_session_id
According to the DDL and DML you provided, this is the output I see:
ACCT_MULTI_SESSION_ID,MAX(ACCTSESSIONTIME)-MIN(ACCTSESSIONTIME) 100014E19E21F16C, 14152 100014E19775F169, 70 100014E1A949316E, 7574
-
How to select lines if a column has the same first and last characters?
Hello
I have a scenario that one of the columns in the table of the student is having names student, (Ex) John, Mary, Donald, Ana, Maria. In this case how can we write a query to retrieve lines for the values if the first and the last character of the student of identical names? Production is expected to be Donald, Ana.
Frank answers the question in the subject of your post, but looking at your examples, I think you wanted
WHERE lower (SUBSTR (student_name, 1, 1)) - 1 character
low = (SUBSTR (student_name,-1)) - last character
Maybe you are looking for
-
iPad connects to the network, is unable to connect to Internet
Received my new iPad. Automatically, it connects to my home network but does not connect to the Internet. I rebooted the router and the iPad, but the same thing. Same problem with the old iPad. That is what it is?
-
I Home School my children and I currently have 1Laptop to use and need one that extinguished my child 4 years and now its asking me for the administration or the power on password? This has CREATED a huge problem my computer asks me a power on passwo
-
How to set indexes to ring ring embedded in a control table
Hello experts, I have a table with a control of the ring inside. I filled this ring with values from a file before displaying the UI. The ring shows now the first point inside, but I want to show another element of the ring. I couldn't find any funct
-
Frozen on blue screen after asking to activate
I just did a reinstall on Windows XP Professional, after that a virus wiped out my file on the Dell laptop structure. Used a CD that was floating around my company because the OS came preinstalled on my laptop and the original disk is no longer with
-
I backed up all my files a long time ago. This is the total of 3 disks. I lost the disc 3. I had to reformat my hard drive and after you have reinstalled windows ect went to restore my files. I only have 2 of the 3 disks, disk 1 and 2. Keep promting