Fetch current Quarter and pass it to custom query
Hi
I need to pass the current date and find the quarter in which the date falls.
The start and end date of the quarter need to be passed as a query parameter, in a custom query in UI designer.
My query is as follows
As shown in above screenshot,I have close_dt_upd(datatype Date).This field should have end date of the quarter as a condition.
Similarly I will have a field start_date which should have Start date of the quarter as condition.
I got the following table in 1402 documentation.
But the above transformation rule is not visible in the query.
Can anyone tell which namespace to use?
How can I retrieve the current quarter start and end dates, and then pass them to the above query?
Thanks,
Vijaya Chavan
Hi,
the most easiest and straight forward approach is
- Ckick the "Binding" tab at the bottom of the Visual Editor
- In the Bindings section click teh green plus icon and choose Generic Bindings | Attribute Value
- point the iterator selection to the iterator used by the table
- choose the column's attribute name from the list of attributes
- Create a method on the ApplicatioNModule IMPL class (should take single argument)
- expose it as a client interfaces so it shows in the Data Controls panel
- In the "Binding" tab, create a method binding for this exposed method
- point the method binding argument to #{bindings.column-attribute-name.inptValue}
So whenever you need to pass the value on to the AM, you just call the method binding
OperationBinding oper = (OperationBinding) bindings.get("name of method");
oper.execute();
Frank
Similar Messages
-
Balance sheet required for current quarter and previous quarter
Hi Guys,
I am using 0FIGL_C10 cube for balance sheet report,i need to create balances for current quarter and previous quarter.
user will enter the fisper, based on fisper it has to show the current quarter and previous quarter balance.
how to calculate the quarter using fisper.you can use offset with ranges.
or
just offset of -1 , -2 & -3 seperately in 3 selections and add it in one column in formula (this will give u current quarter).
similarly offset of -4, -5 , -6 will give u previous quarter result.
total of 6 selection and 2 formulas. hide all selections from display. -
How to get Current Quarter and Fiscal Quarter for a Date - Fiscal Year starts from 1st April
Hi,
I need to calculate current quarter and fiscal quarter in my Sql query.
I have a column for DateTime Datatype.
I need to find out Current Quarter Name like Q12012, Q22012, Q32012, Q42012 and Fiscal Quarter Name as well.
Now Fiacal Year starts from 1st April, and Current Quarter starts from 1st Jan.
For Current Quarter of 2012
Jan-Mar = Q12012
Apr-Jun = Q22012
Jul-Sep = Q32012
Oct-Dec = Q42012
For Fiscal Quarter of 2012 ( starts from 1st Apr, 2011 )
Apr2011-Jun2011 = Q12012
Jul2011-Sep2011 = Q22012
Oct2011-Dec2011 = Q32012
Jan2011-Mar2012 = Q42012
means if its 1st April, 2012,
its a new Fiacal Year 2013 so Fiacal Quarter Name should be Q12013
and its Current Quarter Name should be Q22012
Can you help me to calculate this in a select query for given dates?
Thanks in advance,
NiravThis should do it..
Select
FORMAT(datepart(quarter,getdate()),'Q#')+FORMAT(getdate(),'yyyy') -
Get the Current Quarter and Current Week from date
Hi,
I want to get the Current quarter and Current week from a given date, which function modules should i use?
I tried using function module - 'HR_99S_GET_QUARTER' for getting the quarter but it is throwing an error while loading data. Moreover it doesnt exist in BI7.
Similarly for current week.
Please help. Sample code snippets would be appreciated.
Thanks
JayaYou can use FORM time_conversion wich is the one used by standard in Update Rules:
You can select whether convert 0CALDAY to 0CALWEEK or whatever infobject formats you prefer...
perform time_conversion
using '0CALDAY'
'0CALMONTH'
p_input_date
l_fscvtval
changing RESULT
c_t_idocstate
c_subrc
c_abort.
if c_subrc <> 0 or c_abort <> 0.
exit.
endif.
form time_conversion
using i_timnm_from type rsiobjnm
i_timnm_to type rsiobjnm
i_timvl
i_fiscvarnt type t009b-periv
changing e_timvl
c_t_idocstate type rsarr_t_idocstate
c_subrc like sy-subrc
c_abort like sy-subrc. "#EC *
data: l_timvl type rsd_chavl,
l_result type rsd_chavl.
IF i_timvl CO ' 0'.
CLEAR e_timvl.
EXIT.
ENDIF.
l_timvl = i_timvl.
CALL FUNCTION 'RST_TOBJ_TO_DERIVED_TOBJ'
EXPORTING
i_timnm_from = i_timnm_from
i_timnm_to = i_timnm_to
i_timvl = l_timvl
I_FISCVARNT = i_fiscvarnt
I_BUFFER = rs_c_true
IMPORTING
E_TIMVL = l_result
EXCEPTIONS
INCOMPATIBLE_TOBJS = 1
NO_INPUT_VALUE = 2
FISCVARNT_MISSING = 3
INPUT_NOT_NUMERIC = 4
WRONG_DATE = 5
WRONG_FISCPER = 6
X_MESSAGE = 7
OTHERS = 8
e_timvl = l_result.
ENDFORM. "TIME_CONVERSION -
Display Current Quarter and Previous Quarter???
Hi Gurus,
I Had a requirement to display only the current Quarter and previous quarter in the report level using single quarter column.
and my quarter value type is Q1 2013.
Please anyone help me out on this asap/
Thanks.Hi,
Using time serious function you can acheive this requirement.
http://obieetutorialguide.blogspot.in/2012/02/modeling-time-series-function-in-obiee.html
OBIEE 11g Time Series Function
or,
Using presentation variable you can achieve this.
Re: OBIEE 10g LY YTD returns YTD for past years
The above thread for year you can change to qtr.
Hope this help's
Thanks,
Satya -
Current quarter and four future quarters
Hello Forum Members,
I have a config table with the following data:
Quarter Config Rep_date
Q1-2006|1|1/1/2006
Q2-2006|32|4/12/2006
Q3-2006|321|7/15/2006
Q4-2006|897|12/14/2006
Q1-2007|10|2/12/2007
Q2-2007|10|5/12/2007
Q4-2007|50|11/12/2007
Q1-2008|30|1/1/2008
Q2-2008|57|4/10/2008
Q4-2008|45|12/12/2008
Q3-2008|34|8/8/2008
Q4-2005|21|12/1/2005
Q3-2005|20|8/22/2005
Q2-2005|65|4/14/2005
Q1-2005|65|1/14/2005
Q3-2007|435|9/9/2007
I have to show current quarter and four future quarters in oracle form.
ie
Q4-2007|50|
Q1-2008|30|
Q2-2008|57|
Q3-2008|34|
Q4-2008|45|
Please advise me.
ThanksComing at it from a different angle, you could fix the data before doing the query. This makes the query much simpler, which is good if it has to be used in many places in the application. Obviously the best way would be to make the quarter column a date column, but that's not always possible. A view or a function-based index can do the same job:
DROP TABLE quarters;
CREATE TABLE quarters AS
SELECT a quarter, b config, To_Date(c,'MM/DD/YYYY') rep_date FROM(
SELECT 'Q1-2006' a, 1 b, '1/1/2006' c FROM dual UNION ALL
SELECT 'Q2-2006', 32, '4/12/2006' FROM dual UNION ALL
SELECT 'Q3-2006', 321, '7/15/2006' FROM dual UNION ALL
SELECT 'Q4-2006', 897, '12/14/2006' FROM dual UNION ALL
SELECT 'Q1-2007', 10, '2/12/2007' FROM dual UNION ALL
SELECT 'Q2-2007', 10, '5/12/2007' FROM dual UNION ALL
SELECT 'Q4-2007', 50, '11/12/2007' FROM dual UNION ALL
SELECT 'Q1-2008', 30, '1/1/2008' FROM dual UNION ALL
SELECT 'Q2-2008', 57, '4/10/2008' FROM dual UNION ALL
SELECT 'Q4-2008', 45, '12/12/2008' FROM dual UNION ALL
SELECT 'Q3-2008', 34, '8/8/2008' FROM dual UNION ALL
SELECT 'Q4-2005', 21, '12/1/2005' FROM dual UNION ALL
SELECT 'Q3-2005', 20, '8/22/2005' FROM dual UNION ALL
SELECT 'Q2-2005', 65, '4/14/2005' FROM dual UNION ALL
SELECT 'Q1-2005', 65, '1/14/2005' FROM dual UNION ALL
SELECT 'Q3-2007', 435, '9/9/2007' FROM dual
CREATE OR REPLACE FUNCTION get_qtr_date(p IN VARCHAR2) RETURN DATE DETERMINISTIC AS
BEGIN
RETURN Add_Months(Trunc(To_Date(SubStr(p,4),'YYYY'),'YYYY'), (To_Number(SubStr(p,2,1))-1)*3);
END;
CREATE INDEX function_based ON quarters(get_qtr_date(quarter));
SELECT * FROM quarters
WHERE get_qtr_date(quarter) BETWEEN Trunc(SYSDATE-100,'Q') AND Add_Months(Trunc(SYSDATE-100,'Q'), 12)
ORDER BY get_qtr_date(quarter);
QUARTER CONFIG REP_DATE
Q3-2007 435 09-SEP-07
Q4-2007 50 12-NOV-07
Q1-2008 30 01-JAN-08
Q2-2008 57 10-APR-08
Q3-2008 34 08-AUG-08Another benefit of a function-based index on a column which has to take a specific format is that you can validate the data on the way in rather than checking it on the way out. For example:
CREATE OR REPLACE FUNCTION get_qtr_date(p IN VARCHAR2) RETURN DATE DETERMINISTIC AS
BEGIN
IF InStr(p,'Q') != 1 THEN
Raise_Application_Error(-20000, 'Invalid quarter format');
END IF;
RETURN Add_Months(Trunc(To_Date(SubStr(p,4),'YYYY'),'YYYY'), (To_Number(SubStr(p,2,1))-1)*3);
END;
INSERT INTO quarters VALUES('P3-2009',100,To_Date('10/10/2009','DD/MM/YYYY'));
ORA-20000: Invalid quarter format
ORA-06512: at "TEST.GET_QTR_DATE", line 4 -
How to get data for current week and previous week using customer exit in Bex.
Hi everyone,
I have a scenario in which I need to display data for current week and previous week (based on "sy_datum" the program has to calculate current week and previous week) in Bex using Customer exit. I have created one variable in Bex Query Designer and I have written code for the variable in CMOD. But it is not working fine, (I know that we can do the same by using offset value in Bex). Can some one guide me how to achieve my requirement using customer exit.
Thanks in Advance,
G S Ramanjaneyulu.Hi krishna,
Thanks for your quick reply, can you have a look at my code,
case i_vnam.
WHEN 'ZPWK_CWK'.
ranges : pre_week for sy-datum.
data : start_date type DATS,
end_date TYPE dats .
************FM TO GET FIRST DATE OF CURRENT WEEK ************************
CALL FUNCTION 'BWSO_DATE_GET_FIRST_WEEKDAY'
EXPORTING
DATE_IN = sy-datum
IMPORTING
DATE_OUT = start_date. " WEEK FIRST DATE
end_date = START_DATE + 6. " WEEK LAST DATE
END_DATE = START_DATE - 1. " PREVIOUS WEEK END DATE
START_DATE = START_DATE - 7. " PREVIOUS WEEK START DATE
**********PREVIOUS WEEK DATES IN PRE_WEEK******************
pre_week-SIGN = 'I'.
pre_week-option = 'BT'.
pre_week-LOW = START_DATE.
pre_week-HIGH = END_DATE.
APPEND pre_week.
CLEAR : START_DATE,END_DATE.
endcase.
Regards,
G S Ramanjaneyulu. -
Current quarter and future quarters
Hello Forum members:
Can you please advice me on this:
QUARTER SUM(CONFIG) Report_date
Q1-2007 10 12-Jan-2007
Q2-2007 10 21-Apr-2007
Q3-2007 870 14-Aug-2007
Q4-2007 50 14-Nov-2007
Q4-2006 897 15-Dec-2007
I want the following out put:
Please note that the future quarters should have current quarter sum(config)
Q4-2006 897
Q1-2007 10
Q2-2007 10
Q3-2007 870
Q4-2007 50
Q1-2008 50
Q2-2008 50
Q3-2008 50
Q4-2008 50
My query returns the following:
Q4-2006 897
Q1-2007 10
Q2-2007 10
Q3-2007 870
Q4-2007 50
select quarter, sum(config)
from quarter_test
where rep_Date >= ADD_MONTHS(TRUNC(SYSDATE,'q'),-12) AND
rep_date < ADD_MONTHS(TRUNC(SYSDATE,'q'),15)
group by quarter
order by substr(quarter,-4), substr(quarter,2,1);create table test5(quarter varchar2(7), config number, report_date date)
select * from test5
QUARTER CONFIG REPORT_DATE
Q1-2007 10 1/12/2007
Q2-2007 10 4/21/2007
Q3-2007 870 8/14/2007
Q4-2007 50 11/14/2007
Q4-2006 897 12/15/2007
select quarter, config from
(select quarter, sum(config) config
from test5
where report_Date >= ADD_MONTHS(TRUNC(SYSDATE,'q'),-12) AND
report_date < ADD_MONTHS(TRUNC(SYSDATE,'q'),15)
group by quarter
order by substr(quarter,4,4), substr(quarter,1,2))
union all
select 'Q'|| rownum || '-' || quarter, config from
select substr(quarter,4,4)+1 quarter, config from
select quarter, sum(config) config
from test5
where report_Date >= ADD_MONTHS(TRUNC(SYSDATE,'q'),-12) AND
report_date < ADD_MONTHS(TRUNC(SYSDATE,'q'),15)
group by quarter
order by substr(quarter,4,4) desc, substr(quarter,1,2) desc
where rownum=1)
test, all_objects where rownum <=4
QUARTER CONFIG
Q4-2006 897
Q1-2007 10
Q2-2007 10
Q3-2007 870
Q4-2007 50
Q1-2008 50
Q2-2008 50
Q3-2008 50
Q4-2008 50 -
How will get subquery return multiple values and passing to the main query
Hi all ;
here i given one sql query
1)select decode(a.FLG,'Y','yes','N','no','null')||'] '||a.p_type||' : '|| initcap(replace(substr(b.mgr,0,instr(b.mgr,'@')-1),'.',' '))||' - '||
b.name||' ('|| substr(a.name,0,instr(a.name,'-')-1)||')'
from table1 a
join table3 c on c.emptype = a.emptype
left outer join table2 b on a.name = b.name
where a.mgrid = 100;
if i run this above query returning multiple values depend on sa.mgr values.
like output coming like this
[yes]:2000-anbarasan
[yes]:2700-anb
[yes]:2000-rasan
[yes]:2807-anbarasan
[yes]:2700-anbanu
[yes]:2000-null
2) this sub query i am passing with main query
select sa.mgrid,sa.sal,(select decode(a.FLG,'Y','yes','N','no','null')||'] '||a.p_type||' : '||
initcap(replace(substr(b.mgr,0,instr(b.mgr,'@')-1),'.',' '))||' - '||
b .name||' ('|| substr(a.name,0,instr(a.name,'-')-1)||')'
from table1 a
join table3 c on c.emptype = a.emptype
left outer join table2 b on a.name = b.name
where a.mgrid = 100)" test " from table4 sa,table5 te ,table6 ft where sa.id(+)=te.id and sa.mgr=ft.mgr;
my final out put required like this:
mgrid sal test
100 20000 [yes]:2000-anbarasan
[yes]:2700-anb
[yes]:2000-rasan
[yes]:2807-anbarasan
[yes]:2700-anbanu
[yes]:2000-null
but i am getting erro:
1)missing paranths-it solved
2)single row subquery return more then one row.
give me the correct solution.how will solve this problem
Edited by: anbarasan on Sep 29, 2008 6:49 AM
Edited by: anbarasan on Sep 29, 2008 6:51 AM
Edited by: anbarasan on Sep 29, 2008 6:53 AM
Edited by: anbarasan on Sep 29, 2008 6:56 AM
Edited by: anbarasan on Sep 29, 2008 6:58 AMHi,
It doesn't look like you posted either the complete query or the complete error message (including line number). Try again.
"single row subquery return more then one row" usually means you are using a sub-query in a place where a single expression is expected, for example the column called avg_sal in this query:
SELECT ename
, sal
, (SELECT AVG (sal) FROM scott.dept WHERE deptno = e.deptno) AS avg_sal -- Scalar-sub-query
FROM scott.emp e; The error occurs when the sub-query returns more than one row
If the sub-querry really is supoosed to be returning only one row, the solution is to fix the sub-query, usually be adding something to the WHERE clause.
If the sub-query is supposed to return more than one row, then the main query has to be re-written, perhaps as a join.
Post a little sample data and the results you want from that data if you need help. -
SAPGUI Iview and passing logon language as query string in URL
Dear Portal experts, is it possible to send the sapgui logon language as query string in URL so sso login to EP is language JP and the login to SAPGUI Iview (for windows) can be different langauge eg English. There is a document that talks abt configuration setting for SAPGUI for HTML , but no documentation for SAPGUI for windows using shortcut..
eg : http://serverhost:port/...../xxxx.iview?sap-config-mode=true&sap-language=ja
Please let know ...thanks.
Regards
GabrielHi Gabriel,
There are some context variables available for Generic component of app integrator. You can refer to the below link.
http://help.sap.com/saphelp_nw70/helpdata/en/36/5e3842134bad04e10000000a1550b0/content.htm
I know transaction iView is a different component but worth giving it a try.
Regards,
Mahesh
Edited by: Mahesh Krishnapillai on Jan 6, 2012 1:09 PM -
How to get Current week and No of Weeks for each quarter!!
Hi,
As a part of report development I have to derive Current week and No.of Weeks in Curreny Query. Based on these information I have to calculate Phased target (Calculated KYF).
Phased target = (Target for Quarter / No of weeks in Current Quarter) X Current Week.
We have to derive Current Quarter and Current week from Customer Exit (From Invoice date, which is an entry by Users at report level).
My questions are:
1) We have to derive Two Restricted key figures (by Calweek) for derving No of weeks for Currnet Quarter and Current week in Query level. Based on this info, we have to derive Calculated kef figure for Phased target.
2) And the output is 6 (ex:- 132008) char length for Current week and we have to pick Week info only and we have to populate RKF created for Current week. How we can achieve this.
3) Regarding the No of weeks per for current quarter, we are writing Customer exit to determine Quarter and no of weeks, but how to bring this info in query level.
4) Is there any standard code available (SAP Exit) to find Current week and No of Weeks in Current quarter.
Regards,
Suresh MolliHi Venkat Molli,
Follow the below step for the doing the same:
1. Create a customer exit variable on calweek.
2. Restrict the created variable for respective info object.
3. To Populate the data write code in CMOD.
in enhancement function module: EXIT_SAPLRRS0_001 -> in Include ZXRSRU01 write the below code:
WHEN '<variable name>'.
IF i_step = 1.
CLEAR l_s_range.
CALL FUNCTION 'RSVAREXIT_0P_CWEEK'
IMPORTING
e_t_range = lt_week.
READ TABLE lt_week INTO l_s_range1 INDEX 1.
v_last_week = l_s_range1-low+4(2).
v_last_week = v_last_week - 1.
l_s_range1-low+4(2) = v_last_week.
l_s_range-low = l_s_range1-low.
l_s_range-sign = 'I'.
l_s_range-opt = 'EQ'.
APPEND l_s_range TO e_t_range.
ENDIF.
4. Execute the report.
I hope you can handle you issue now.
Assign points if it is helpful.
Regards,
S P. -
How to derive Current week and Number of Weeks for present quarter.
Hi,
Currently we are developing a report on Actuals and Planned sales. We have two different data targets to hold these information.
CRM team will provide targets for BP monthly in CRM table, from where we are extracting the data into BW and report exection frequency is Daily.
Report Output format:-
1) Target1St Month in the quarter, Target2nd Month in the quarter, Target3rd Month in the quarter, Target Quarter, Month To date (Taget for Current month - Sales till today),
Let us assume we are Q1 and user executing this report on end of March Target1 = Jan, Target2 = Feb, Target 3 = March and Quarter target = Target1 + Target2 + Target 3.
We can achieve this by offset variables.
But if users are exectuing this report Apr (Q2) then Target1 = Apr target , target2 and target3 =0
Becoz we are in Q2 and first month of the quarter. If users are executing this report in May target1 should be Apr target and Target 2 = May target and Target3rd month should be Zero.
2) We have one keyfigure called as Quarter Phased Target = (Quarter target/ No of weeks in current quarter)* current week; For this we have to get No of weeks in every quarter and Curren week (when the reports get executed).
Let us assume we are executing this report on 25th jan and target for that month = 122units then Quarter phased target = [(122 + 0 (For Feb)+ 0 (For Mar) )/ 13] X4
4 is becoz we are in 4th in that quarter,
13 is becoz no of weeks in that quarter.
0 (For Feb) - Becoz we are in Jan only..
Hence please let me know how to get No of weeks in Current quarter and Current week for every quarter..
All the helpful answers will be awarded with full points.
Regards,
sureshhi,
For the first querry.
the problem is because u are using calmonth.
Instead of using cal month use fiscal period.
When u use fiscal period the data will be shown automatically for the Previous months using offsets.
u have to take taht in ur transformation and should map it to constant value depending on the fiscal periods of ur compnay?
march- apr,jan-dec etc.
for teh second querry there would be some charecteristic which might give data in weeks as well just check that and if availabe u can use it.
am not too sure abt it. -
Set date Parameters to Default to Current Quarter
I have 2 date parameters in my report. I would like these parameters to be defaulted to the 1st day of the current quarter and the last day of the current quarter. I need these to be dafaulted because the report is going to be scheduled through BusinessObjects InfoView. I need the flexabilty to allow users to run the report on any date they want, but it needs to default so the scheduling works as expected. Can this be done and if so any assistance would be grateful. Thank you.
Thomas,
although you can't set a prompt / parameter to default like this, you can set a record selection to do this...here's how...
1) in your StartDate and your EndDate parameters set a default value of 1888,08,08
2) create a new formula called Start with syntax like
if {?startdate} = date(1888,08,08)
then
if month(currentdate) in [1,2,3] then date(year(currentdate),01,01) else
if month(currentdate) in [4,5,6] then date(year(currentdate),04,01) else
if month(currentdate) in [7,8,9] then date(year(currentdate),07,01) else
if month(currentdate) in [10,11,12] then date(year(currentdate),10,01)
else {?startdate};
3) create a new formula called End with syntax like
if {?enddate} = date(1888,08,08)
then
if month(currentdate) in [1,2,3] then date(year(currentdate),03,31) else
if month(currentdate) in [4,5,6] then date(year(currentdate),06,30) else
if month(currentdate) in [7,8,9] then date(year(currentdate),09,30) else
if month(currentdate) in [10,11,12] then date(year(currentdate),12,31)
else {?enddate};
4) change your record selection formula to something like
{table.datefield} in {@start} to {@end}
now if the end user doesn't actually put in custom dates, the record filter will default to the current quarter. if they use custom dates, the those dates will be used.
of course you will have to edit the above syntax to your parameter names and datefield name. this method will also pass the filter to the database to increase performance.
cheers,
jamie -
Define months on current quarter
I successfully created a report with the data of ’current quarter’ and ’last quarter’.
Now I want to finetune that by adding month 1, month 2, month 3 of these quarters.
How can this be achieved?
I support by creating a variable on month, but I do not know how.
JohnHi John
Yes, you can create customer exit variables to populate the data based on month. Get help from ABAP team in your project and do this.
Alternatively you can also achieve this in infocube level which is easier than customer exit variables. You already have quarter. I am sure you should have calculated it in transformation using some date field. Add calmonth also in the transformation and calculate it in using the same date field.
Add calmonth also in your report which will give you the output based on month.
Regards
Karthik -
Complete Weeks of current Quarter ..
Hello,
we have a time table (exp.: D_TIME) listing every day between 1.1.2006 to 1.1.2017
and i am triying to filter with following criteria ..
Complete Weeks of the current Quarter (Only weeks wich are from Monday to Sonday included in the current quarter)
AND < SYSDATE
The borders of this Filter are correct but in some days teh result is empty ..
+
SELECT * D_TIME
WHERE
D_TIME.DATE_X BETWEEN NEXT_DAY(TRUNC(TRUNC(trunc(SYSDATE), 'iw'),'Q')-1,'Monday')
AND TRUNC(trunc(SYSDATE),'iw')-1
+
ANY Suggestions .. ? Thanks ..Hi,
To find all the days between the first Monday in this quarter, and the last Sunday before today, inclusive:
SELECT *
FROM d_time
WHERE date_x BETWEEN TRUNC ( TRUNC (SYSDATE, 'Q') + 6
, 'IW'
AND TRUNC (SYSDATE, 'IW') - 1
;This assumes that d_time.date_x is always midnight (00:00:00).
When you TRUNCate a date to some longer time division (such as a quarter),that implies TRUNCating to all smaller divisons that are contained in it, so
TRUNC (d, 'IW') truncates the hours, minutes and seconds; there's no need to say
TRUNC (TRUNC (d), 'IW').
NEXT_DAY is very handy, but it depends on NLS_DATE_LANGUAGE. TRUNC (d, 'IW') works the same regardless of your NLS settings.
This may still retun 0 rows. For example, as of Sunday, October 9, 2001 there had not been a Monday-to-Sunday week that fell entirely in the current quarter. (The week starting on Monday, Octoeber 3 was not yet complete, by a fraction of a day.)
I hope this answers your question.
If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all tables, and also post the results you want from that data.
Explain, using specific examples, how you get those results from that data.
Always say which version of Oracle you're using.
Maybe you are looking for
-
I am facing problem in starting ShellHWDetection service Error code 1075,please help
I am facing problem in starting ShellHWDetection service Error code 1075,please help
-
Open Directory Master creation failure.
I am running into consistent Failures while attempting to setup Open Directory Master on 10.8 server. It seems to fail in creating an Intermidiary CA and suggests there is already one. I have combed Keychain for, and removed any entires that refer to
-
Import a mov from qT, in Motion it has the wrong proportion
I am trying to import a project into Motion from Quicktime, the quicktime file was created at 16:9 1024 x 576 pixels PAL from a Final Cut Project. When I open it in Motion the movie is squashed it is too tall and not wide enough. I have tried acessin
-
ADF UIX: How to use MessageCheckbox to trigger a component to be rendered?
I have two UIX component: messageCheckBox model="${bindings.Servicelocal}" and messageStyledText id="mst_TextChange". I want messageStyledText to be showed if messageCheckBox was checked. I want to know how to set the ârenderedâ property of the M
-
Please help me about the Iplanet Messaging Server,SOS!!!!!
I have just installed Iplanet DS and IPlanet Messaging Server 5.2 .But I can only use web to check or send mail . When I use Out Look Express ,I can only send mail and not check mail.Please give me the reason and solution.