function round date
cant that I round the date like that?or only sysdate can be rounded or if the date is stored in a variable can only be rounded
Select double round('21-feb-1999','mon');
Hello
987018 wrote:
cant that I round the date like that?
or only sysdate can be rounded
No, there is nothing in particular SYSDATE. Any DATE may be rounded off.
or if the date is stored in a variable can only be rounded
No, it does not matter if the DATE is a column, a literal, a variable, the result of a function, or any other form of expression, just as long as it's a DATE.
Select double round('21-feb-1999','mon');
The problem is that 21 February 1999 "is not a DATE; It's a VARCHAR2.
TO_DATE allows to convert a DATE VARCHAR2:
SELECT ROUND ( TO_DATE ('21-feb-1999', 'dd-mon-yyyy')
, 'mon'
) AS r
FROM dual;
or use a literal DATE:
SELECT ROUND ( DATE '1999-02-21'
, 'mon'
) AS r
FROM dual;
Tags: Database
Similar Questions
-
Is function like the function of date and time picker in the ICB 8.5?
I need the function as "date and time picker control" used in activeX, but my operating system (windows 7 Bits without office software) is not the «Microsoft date controller» and time picker I am looking article in the internet which mention this register the MSComctl2.ocx in the windows\system32, but he could not operator in my operating system (it's not allow to save the controller). Help me, please.
Already, I discovered that the problem on the service of DTP in the 64-bit Windows 7 could not used. Because, the DTP is 32 bits, it should use the administrator to register the 'mscomct2.ocx file' which must be replace in the % windows/SysWOW64 and used the 'mscomct2.ocx regsvr32.exe"in console windows.
-
Overload function "value data" problem on DataGrid Renderer button
Hi all, I hope it is something simple.
I have a class that extends the mx.controls.Button mx.core.IDataRenderer and implements. I need to set the icon of the button whenever the Data property has the value of the data grid. My problem is that my set/get overloaded function of data are never called (I reinforced with the debugging code). Instead the set/get in Container.as functions (3.4 the Flex SDK kit) called.
Here's the Basic code:
exportButtonRenderer.as package controls
{
import flash.events.Event;
import flash.events.MouseEvent;
Import mx.controls.Button;
Import mx.core.IDataRenderer;
Import mx.controls.dataGridClasses.DataGridListData;
Import mx.controls.listClasses.BaseListData;
Import mx.events.FlexEvent;
Import mx.controls.Alert;
Import model.descriptors.compDescriptor;
Import events.exportClickedEvent;
public class exportButtonRenderer extends button implements IDataRenderer
{
Embed your icons
[(Embed(source='/assets/icons/export.png')]
[Bindable]
public static var imageExport: Class;
[(Embed(source='/assets/icons/blank.png')]
[Bindable]
public static var imageBlank: Class;
public void exportButtonRenderer()
{
Super();
}
private var _listData:DataGridListData;
override public function get listData (): BaseListData
{
Return _listData;
}
override public function set listData(value:BaseListData):void
{
_listData = DataGridListData (value);
}
private var _data:Object;
public override function get data (): Object
{
return _data;
}
override public function set data(value:Object):void
{
_data = value;
}
override the clickHandler(event:MouseEvent):void function
{
super.clickHandler (event);
}
}
}Now I know that I am using the Flexlib TreeGrid and not a standard DataGrid but when I trace through all the code all code firing the set/get functions is in any case the DataGrid control.
Here is the my def grid in my main application mxml:
Header 1 < flexlib:TreeGrid
ID = "MKTXGrid".
dragEnabled = 'false' sortableColumns = 'false' showRoot = "false".
(disclosureClosedIcon="@Embed(source='/assets/icons/arrow_right.png')".
(disclosureOpenIcon="@Embed(source='/assets/icons/arrow_down.png')".
(folderOpenIcon="@Embed(source='/assets/icons/psd.png')".
(folderClosedIcon="@Embed(source='/assets/icons/psd.png')".
Click = "MKTXGrid_clickHandler (Event)" "
doubleClickEnabled = "true" doubleClick = "MKTXGrid_doubleClickHandler (event)" left = "0" right = "0" top = low "0" = "16" > "
< flexlib:columns >
< flexlib:TreeGridColumn dataField = "Name" headerText = "Name" minWidth = "200" width = "200" editable = "true" / >
< mx:DataGridColumn dataField = 'ExportName"headerText ="Export Name"/ >
< mx:DataGridColumn dataField = "Export" headerText = "Export" width = "50" minWidth = "20" resizable = "false" >
< mx:itemRenderer >
< mx:Component >
< mx:Box horizontalAlign = "center" width = "100%" verticalScrollPolicy = "off" horizontalScrollPolicy = "off" >
(< contrôles: exportButtonRenderer label = «Exporter» icon="@Embed(source='assets/icons/export.png')" width = "12" height = "12" useHandCursor = "true" >
< controls: Click >
<! [CDATA]
Import events.exportClickedEvent;
var e:exportClickedEvent = new exportClickedEvent();
e.itemData = data;
dispatchEvent (e);
[]] >
< / controls: Click >
< / controls: exportButtonRenderer >
< / mx:Box >
< / mx:Component >
< / mx:itemRenderer >
< / mx:DataGridColumn >
< / flexlib:columns >
< / flexlib:TreeGrid >
Nothing too special happens.I know it can be done, I've seen examples in the SDK:
Either incidentally, I reinforced with the code in the TreeGridItemRenderer class in Flexlib which works correctly and the class def starts like this:
TreeGridItemRenderer.as import flash.display.DisplayObject;
to import flash.display.InteractiveObject;
import flash.display.Shape;
import flash.display.Sprite;
import flash.events.Event;
import flash.events.MouseEvent;
to import flash.geom.Point;
import flash.geom.Rectangle;
Import flexlib.controls.TreeGrid;
Import mx.controls.Image;
Import mx.controls.dataGridClasses.DataGridListData;
Import mx.controls.listClasses.BaseListData;
Import mx.controls.listClasses.IDropInListItemRenderer;
Import mx.controls.listClasses.IListItemRenderer;
Import mx.core.IDataRenderer;
Import mx.core.IFlexDisplayObject;
Import mx.core.IToolTip;
Import mx.core.SpriteAsset;
Import mx.core.UIComponent;
Import mx.core.UITextField;
Import mx.events.FlexEvent;
Import mx.events.ToolTipEvent;
Import mx.events.TreeEvent;
Import mx.managers.ILayoutManagerClient;
Import mx.styles.IStyleClient;
SerializableAttribute public class TreeGridItemRenderer extends UIComponent
implements IDataRenderer,
IDropInListItemRenderer,
ILayoutManagerClient,
IListItemRenderer
{...Any help would be great!
It's because you put your component in a box. The DataGrid control is affecting .data property of the box and without code is on your component. You shouldn't really need box. You can override updateDisplayList to Center your button instead.
Alex Harui
Flex SDK Developer
Adobe Systems Inc..
-
How to use the TRUNC function with dates in the expression builder in OBIEE.
Hello
How to use the TRUNC function with dates in the expression builder in OBIEE.
TRUNC (SYSDATE, 'MM') returns 1 July 2010"where sysdate is July 15, 2010 ' in SQL. I need to use the same in the expression builder in the logical layer mdb column.
Thanks in advanceUse it instead:
TIMESTAMPADD (SQL_TSI_DAY, (DAYOFMONTH (CURRENT_DATE) *-1) + 1, CURRENT_DATE) -
Dear community,
Recently, I wrote a program that corresponds to a Gaussian function to certain data of intensity that I shot a picture of a fluorescent NANOPARTICLE. Here's an overview:
My program would be much more useful if I could adapt the data to a Sinc function instead of a Gaussian. Could someone please give me a few points in the right direction on how to do it? I'm very new to LabVIEW, so maybe I need a little more help than just what VI to use. I would appreciate your help.
Please note: I need to adapt to all data, not just half.
I use version 9.0.1 with Windows 7 64-bit operating system.
My program is attached below.
Thank you!
-Patrick
Here is a quick attempt to fit all 2D data. Seems to work very well. (LabVIEW 9.0)
- Run the VI. It will start the installation immediately.
- Change the settings of simulation at any time to see the result simulated using the template (at the bottom right)
- Once the editing is complete, you can drag the yellow slider to inspect the data and along a vertical line.
The attached zip file contains the toplevel VI VI VI model and image. To a new folder and load and run the VI toplevel.
Since you have little data, it probably helps to fit all the data instead of a single line. Let me know if something is not clear. To be honest, I don't think that a square sinc is the correct model. There is no real wings in your data!
-
Application function rounded to the whole of the channel
I have a channel in tiara with a large amount of values (36,000,000) contain the values on 13 decimals.
I would like to round the value to about 4 or 5 decimal places max.
Can someone help me understand how to do this in DIAdem.
Example:
0.3784729837492-> 0.37847
I want this for each value in the channel.
can someone help me understand how to do this?
Thanks in advance,
Tom
From D-cubed method of work, but with 36,000,000 points given, it will take a lot of time. Use the calculator. Copy this function in the ECU for analysis, and it will happen almost instantly. Replace the 3 by the desired number of decimal places.
Ch("[1]/Channel") = Round (ch("[1]/ChannelToBeRounded"), 3)
If you need a VB Script:
Dim ChannelToRound, DecimalPoints
ChanneltoRound = "[1]" / ChannelToBeRounded " ' set the channel to round here"
DecimalPoints 6 = ' specify the number of decimals"This will create a new channel called"Channel"in Group 1 with the rounded values
-
Connection (or not) the entrance to 'type' of function 'variant data?
I noticed (again i) assumed that when I connect an output "Data Variant" connector of a VI or a known type indicator, the thread automatically adopt the correct type. Exports means that I don't have to connect a wire to the 'Type' of the 'variant data?
There are many similar situations where this shortcut does not work. For example, the variant of wiring data function for a bundle by node Name will automatically select the target type of the conversion. I suppose that the index case is a very specific optimization, and this isn't a generally available shortcut.
-
Error 91 - try to use the variant of the function of data
I'm running a problem when you try to use variations in my application. I have a setup of State machine that a State creates a list of tasks (cluster of tables), and then converts it to the Variant. The variant is fed into a shift register that allows me to access the list of tasks of a different State.
The problem comes when I try to use the variant of the function Data. I right click on the task cluster to create a constant and then wire to the TYPE of the variant of the function Data. I wire the variant of cluster of task to the terminal of the VARIANT. When I run the VI, I get error 91: or the possible reasons: LabVIEW: the variant data type is not compatible with the data type of wired for the input type. ».
How can I get this error if the type that I have connected to a Terminal TYPE of the Variant Data terminal is a constant created from the exact type created a variant of?
Section of the machine of the State where I wire the cluster variant:
Section of the machine of the State where I use the data out of the cluster variant:
The constant wire to the terminal of data TYPE variant was created from the cluster that is connected to the Variant type data. I don't understand how there is a type mismatch?
Is there another State between these two? I notice you have some tunnels 'Use default if unwired' coming out of the structure of your business. First of all, clear on the tunnels. Second, in cases where you do not only affect the data, the data directly from the tunnel entrance in the tunnel exit of the wire. I recommend using the tunnels linked to make it even easier on yourself.
With the default tunnels being output, your variant coming could really be empty, so the conversion fails.
-
On the function of Date selection?
Hello
I've been looking for a while now, and I've not found anything. I have a DateField and I want to call a function when the user changes the date in this field (I want to update certain content in an ObjectChoiceField). Is there a good way to do this?
Thank you
Ben
You can add a fieldchangelistener field.
-
function with dates to compare?
Hi all
in my test examples, which must extend, problem start by employees who start working
previous year (2014, 2013...) more months then sys - 10 month and day to start working more then 28 large
all other dates are working fine.
At this point I've seen like this:
SELECT SUM ((extrait (an (SYSDATE))-extract (year DATE_OF_BEGIN_WORK))) as the year.
SUM (abs (extract(month from SYSDATE)-extract(month from DATE_OF_BEGIN_WORK))) as month,
SUM (abs (extract(day from SYSDATE)-extract(day from DATE_OF_BEGIN_WORK))) as day, group employ_id employ_id table_a where active = 1
are there solutions for creating features that compare the dates in the table:
table_a have colum DATE_OF_BEGIN_WORK compare with sysdate
case 1:
months from the date of start to work > sysdate current months and days of the date to start work > current sysdate day and date of start working < sysdate year then
(extract (YEAR sysdate)-extract (YEAR DATE_OF_BEGIN_WORK));
(Excerpt extracted from (DATE_OF_BEGIN_WORK months) - (sysdate month));
(extract (DATE_OF_BEGIN_WORK days) - excerpt (sysdate days));
case 2:
months from the date of starting work < sysdate current months and the days of the date to start work < current sysdate day and date of start working < sysdate year then
(extract (YEAR sysdate)-extract (YEAR DATE_OF_BEGIN_WORK));
((sysdate sysdate months) extract - extract (DATE_OF_BEGIN_WORK month));
((sysdate day) extract - extract (DATE_OF_BEGIN_WORK days)) + 1;
case 3:
months from the date of start to work > sysdate current months and days of the date to start work > current sysdate day and date of start working < sysdate year then
(extract (YEAR sysdate)-extract (YEAR DATE_OF_BEGIN_WORK))-1;
((extract(month from DATE_OF_BEGIN_WORK)-12) - extract (DATE_OF_BEGIN_WORK month));
(extract (DATE_OF_BEGIN_WORK days) - EXTRACTED (LAST_DAY DATE (DATE_OF_BEGIN_WORK)) + extract (sysdate days)) + 1;
no idea how to solve this problem with the functions will be very useful
concerning
Gordan
It seems you are trying to re - invent most of date mathematics that Oracle has obtained already integrated into it. You'll just put in trouble, especially when there are leap years etc.
How about something like this?
SQL > with (id, dt) t (select 1, to_date('02/06/2010','MM/DD/YYYY') of all the double union)
2 Select 2, to_date('11/29/2001','MM/DD/YYYY') of all the double union
3 select 3, to_date('02/06/2011','MM/DD/YYYY') of all the double union
4. Select option 4, double to_date('10/10/2011','MM/DD/YYYY')
5 )
6 --
7. end of test data
8 --
9 select id, dt
10, floor (months_between(sysdate,dt)/12) years
11, floor (mod (months_between (sysdate, dt), 12)) months
12 - day be ambiguous because of the number of days in a different month
13. you could design your own algorithm to give the desired results, but it is a good approximation
14, floor (sysdate-(add_months (dt, floor (months_between (sysdate, dt))) as dys
15 t
16.
ID DT YEARS MONTHS DYS
---------- ----------- ---------- ---------- ----------
1-6 FEBRUARY 2010 5 8 22
2 29 NOVEMBER 2001 13 10 29
3-6 FEBRUARY 2011 4 8 22
4-10 OCTOBER 2011 4 0 184 selected lines.
-
Get the custom IdocScript function contributor data file
Hello
I have a requirement to retrieve a number of elements of a given contributor data file. The problem is, I don't know how to retrieve the XML code inside a custom component of IdocScript.
Given the content of the data contributor file ID, is there an easy way to get the XML file, or do I need to use with a service call?
Thank you!
If it's a Java component, why not just get the direct file system XML file? The demand function, you could have a file path in the binder... If not, use the IdcFileDescriptor object:
https://groups.Yahoo.com/neo/groups/intradoc_users/conversations/topics/25937
-
PL/SQL FUNCTION: Passage date &; string as parameter
Hello
I have a situation where I have to convert the ISO date format Date [YYYY-MM - DDTHH24:MI]
Is function def. : FN_ISO (IN_DATE Varchar2, Varchar2 IN_TIME)
Front-end for the date and time, I can enter in 3 different ways.
Input 1. what date / time is completely known
Date: 5 April 2015
Time: 23:56
Input 2. When the date is known, but the time is unclear (the hour is UNK)
Date: 5 April 2015
Time: UNK:56
Entry 3. When the date and time are unknown (month is UNK)
Date: 05-UNK-2015
Time: UNK:56
Here, I am facing the problem with the Time parameter. Please find below scenarios:
Scenario 1: If the time is complete (as input 1) then I'll pass the data type Date in 2nd parameter (5 April 2015, which contains the time internally)
Scenario 2: If the time is incomplete or partially known (as input 2) then I'll pass the Varchar2 data type in 2nd parameter (UNK:56 as string)
Problem statement:
Consider scenario 1; If date & time is over so I'm passing the data type Date (April 5, 2015 23:56) Varchar2, then time will be 5 April 2015 00:00, however I need to get the time (23:56)
Note:
-I can't use the overload of functions.
-I can not change the way call function which I now call.
-I can't do second parameter date because in scenario 2 I have to pass the string "UNK:56".
Please suggest me, how I can address the issue. Your help would be very appreciated.
Thanks in advance!
create or replace function fun_iso (IN_DATE VARCHAR, IN_TIME VARCHAR2 ) return varchar2 is V_ISO varchar2(20); begin SELECT (case when regexp_like(IN_DATE,'(UNK|\d+)/(UNK|\d+)/(UNK|\d+)') THEN REGEXP_REPLACE((REGEXP_REPLACE(translate(in_date||' '||in_time,'/ ','-T'),'UNK|NUL','-')),'(:|-|T)+$') WHEN regexp_like(IN_DATE,'\d+-(\w+|\d+)-(\d+)') then REGEXP_REPLACE((REGEXP_REPLACE(translate(TO_char(to_date(IN_DATE,'DD-MM-YY'),'YYYY-MM-DD')||' '|| /*for scenario 1*/ (CASE WHEN regexp_like(IN_TIME,'(\d+)-(\w+)-(\d+)') THEN DECODE(TO_CHAR((IN_TIME),'HH24:MI:SS'),'00:00:00', NULL,TO_CHAR(IN_TIME,'HH24:MI:SS')) /* Here i need time if i will pass 05-Apr-2015*/ ELSE NULL END) ,'/ ','-T'),'UNK|NUL','-')),'(:|-|T)+$') else '0' END) INTO V_ISO from dual; RETURN V_ISO; end; / /* Use below table : line 35 is scenario 1 */ select a.*, fun_iso(IN_DATE, IN_TIME) FROM ( (SELECT '2015-01-15T22:29:59 ' ISO_DATE_TIME, '2015/05/05' IN_DATE , '22:29:59' IN_TIME FROM DUAL UNION SELECT ' ' ISO_DATE_TIME, 'UNK/UNK/UNK' IN_DATE , '22:29:NUL' IN_TIME FROM DUAL UNION SELECT ' ' ISO_DATE_TIME, '01-Jan-15' IN_DATE , '22:UNK:NUL' IN_TIME FROM DUAL UNION SELECT ' ' ISO_DATE_TIME, '01-Jan-1948' IN_DATE , '22:29:NUL' IN_TIME FROM DUAL UNION SELECT ' ' ISO_DATE_TIME, '01-05-15' IN_DATE , '22:29:NUL' IN_TIME FROM DUAL UNION SELECT ' ' ISO_DATE_TIME, '25-05-2015' IN_DATE , '22:29:NUL' IN_TIME FROM DUAL UNION --SELECT ' ' ISO_DATE_TIME, '25-05-2015' IN_DATE , TO_CHAR(TO_DATE('01-AUG-14 23:56:00','DD-Mon-YY HH24:MI:SS')) IN_TIME FROM DUAL UNION SELECT '2009' ISO_DATE_TIME, '2009/UNK/UNK' IN_DATE , 'UNK:UNK:NUL' IN_TIME FROM DUAL UNION SELECT '2009---25' ISO_DATE_TIME, '2009/UNK/25' IN_DATE , 'UNK:UNK:NUL' IN_TIME FROM DUAL UNION SELECT '--03-25' ISO_DATE_TIME, 'UNK/03/25' IN_DATE , 'UNK:UNK:NUL' IN_TIME FROM DUAL UNION SELECT '--03--T-:15' ISO_DATE_TIME, 'UNK/03/UNK' IN_DATE , 'UNK:15:NUL' IN_TIME FROM DUAL UNION SELECT '2009-03 ' ISO_DATE_TIME, '2009/03/UNK' IN_DATE , 'UNK:UNK:NUL' IN_TIME FROM DUAL UNION SELECT '2009-03--T12' ISO_DATE_TIME, '2009/03/UNK' IN_DATE , '12:UNK:NUL' IN_TIME FROM DUAL ) ) a;
Hello
Here's one way:
FUNCTION to CREATE or REPLACE fun_iso
(in_date in VARCHAR2
in_time IN VARCHAR2
)
RETURN VARCHAR2
DETERMINISTIC
IS
month_name VARCHAR2 (51): = ' JAN Feb MAR Apr MAY June July Aug SEP OCT NOV DEC UNK;
month_num VARCHAR2 (50): = '01 02 03 04 05 06 07 08 09 10 11 12-';
BEGIN
RETURN SUBSTR (in_date,-4)
|| '-'
|| SUBSTR (month_num
INSTR (month_name
, SUBSTR (in_date, 4, 3)
)
2
)
|| '-'
|| SUBSTR (in_date, 1, 2)
|| ' T '
|| CASE
WHEN SUBSTR (in_time, 1, 3) = "UNK".
THEN '-'
Of OTHER SUBSTR (in_time, 1, 2)
END
|| '-'
|| SUBSTR (in_time-2)
;
END fun_iso;
/
If your needs are more complex, you can do this drill several assignments, where you build a string a little at a time, and RETURN this string at the end.
-
Problem with analytical function for date
Hi all
ORCL worm:
Oracle Database 11 g Enterprise Edition Release 11.2.0.2.0 - 64 bit Production
PL/SQL Release 11.2.0.2.0 - Production
"CORE 11.2.0.2.0 Production."
AMT for Linux: Version 11.2.0.2.0 - Production
NLSRTL Version 11.2.0.2.0 - Production
I have a problem with the analtical for the date function. I'm trying to group records based on timestamp, but I'm failing to do.
Could you please help me find where I'm missing.
THXThis is the subquery. No issue with this. I'm just posting it for reference. select sum(disclosed_cost_allocation.to_be_paid_amt) amt, substr(reference_data.ref_code,4,10) cd, to_char(external_order_status.status_updated_tmstp, 'DD-MON-YYYY HH24:MI:SS') tmstp, DISCLOSED_CLOSING_COST.DISCLOSED_CLOSING_COST_ID id FROM Deal.Fee_Mapping_Definition , Deal.Fee_Index_Definition , Deal.Fee_Closing_Cost_Item, Deal.Closing_Cost, Deal.Document_Generation_Request, deal.PRODUCT_REQUEST, deal.External_Order_Request, deal.External_Order_Status, deal. DISCLOSED_CLOSING_COST, deal.DISCLOSED_COST_ALLOCATION, deal.reference_data WHERE Fee_Mapping_Definition.Fee_Code = Fee_Index_Definition.Fee_Code AND Fee_Index_Definition.Fee_Index_Definition_Id = Fee_Closing_Cost_Item.Fee_Index_Definition_Id AND Fee_Closing_Cost_Item.Closing_Cost_Id = Closing_Cost.Closing_Cost_Id AND CLOSING_COST.PRODUCT_REQUEST_ID = Document_Generation_Request.Product_Request_Id AND closing_cost.product_request_id = product_request.product_request_id AND Product_Request.Deal_Id = External_Order_Request.Deal_Id AND external_order_request.external_order_request_id = external_order_status.external_order_request_id AND external_order_request.external_order_request_id = disclosed_closing_cost.external_order_request_id AND DISCLOSED_CLOSING_COST. DISCLOSED_CLOSING_COST_ID = DISCLOSED_COST_ALLOCATION.DISCLOSED_CLOSING_COST_ID AND Fee_Index_Definition.Fee_Index_Definition_Id = Disclosed_Closing_Cost.Fee_Index_Definition_Id AND Fee_Mapping_Definition.Document_Line_Series_Ref_Id = Reference_Data.Reference_Data_Id AND Document_Generation_Request.Document_Package_Ref_Id IN (7392 ,2209 ) AND External_Order_Status.Order_Status_Txt = ('GenerationCompleted') AND Fee_Mapping_Definition.Document_Line_Series_Ref_Id IN ( 7789, 7788,7596 ) AND FEE_MAPPING_DEFINITION.DOCUMENT_TYPE_REF_ID = 1099 AND Document_Generation_Request.Product_Request_Id IN (SELECT PRODUCT_REQUEST.PRODUCT_REQUEST_id FROM Deal.Disclosed_Cost_Allocation, Deal.Disclosed_Closing_Cost, DEAL.External_Order_Request, DEAL.PRODUCT_REQUEST, Deal.Scenario WHERE Disclosed_Cost_Allocation.Disclosed_Closing_Cost_Id = Disclosed_Closing_Cost.Disclosed_Closing_Cost_Id AND Disclosed_Closing_Cost.External_Order_Request_Id = External_Order_Request.External_Order_Request_Id AND External_Order_Request.Deal_Id = Product_Request.Deal_Id AND product_request.scenario_id = scenario.scenario_id AND SCENARIO.SCENARIO_STATUS_TYPE_REF_ID = 7206 AND product_request.servicing_loan_acct_num IS NOT NULL AND product_request.servicing_loan_acct_num = 0017498379 --AND Disclosed_Cost_Allocation.Disclosed_Cost_Allocation_Id = 5095263 ) GROUP BY DISCLOSED_CLOSING_COST.DISCLOSED_CLOSING_COST_ID, External_Order_Status.Status_Updated_Tmstp, Reference_Data.Ref_Code, disclosed_cost_allocation.to_be_paid_amt order by 3 desc, 1 DESC; Result: 2000 1304-1399 28-JUL-2012 19:49:47 6880959 312 1302 28-JUL-2012 19:49:47 6880958 76 1303 28-JUL-2012 19:49:47 6880957 2000 1304-1399 28-JUL-2012 18:02:16 6880539 312 1302 28-JUL-2012 18:02:16 6880538 76 1303 28-JUL-2012 18:02:16 6880537 But, when I try to group the timestamp using analytical function, select amt ,cd ,rank() over(partition by tmstp order by tmstp desc) rn from (select sum(disclosed_cost_allocation.to_be_paid_amt) amt, substr(reference_data.ref_code,4,10) cd, to_char(external_order_status.status_updated_tmstp, 'DD-MON-YYYY HH24:MI:SS') tmstp, DISCLOSED_CLOSING_COST.DISCLOSED_CLOSING_COST_ID id FROM Deal.Fee_Mapping_Definition , Deal.Fee_Index_Definition , Deal.Fee_Closing_Cost_Item, Deal.Closing_Cost, Deal.Document_Generation_Request, deal.PRODUCT_REQUEST, deal.External_Order_Request, deal.External_Order_Status, deal. DISCLOSED_CLOSING_COST, deal.DISCLOSED_COST_ALLOCATION, deal.reference_data WHERE Fee_Mapping_Definition.Fee_Code = Fee_Index_Definition.Fee_Code AND Fee_Index_Definition.Fee_Index_Definition_Id = Fee_Closing_Cost_Item.Fee_Index_Definition_Id AND Fee_Closing_Cost_Item.Closing_Cost_Id = Closing_Cost.Closing_Cost_Id AND CLOSING_COST.PRODUCT_REQUEST_ID = Document_Generation_Request.Product_Request_Id AND closing_cost.product_request_id = product_request.product_request_id AND Product_Request.Deal_Id = External_Order_Request.Deal_Id AND external_order_request.external_order_request_id = external_order_status.external_order_request_id AND external_order_request.external_order_request_id = disclosed_closing_cost.external_order_request_id AND DISCLOSED_CLOSING_COST. DISCLOSED_CLOSING_COST_ID = DISCLOSED_COST_ALLOCATION.DISCLOSED_CLOSING_COST_ID AND Fee_Index_Definition.Fee_Index_Definition_Id = Disclosed_Closing_Cost.Fee_Index_Definition_Id AND Fee_Mapping_Definition.Document_Line_Series_Ref_Id = Reference_Data.Reference_Data_Id AND Document_Generation_Request.Document_Package_Ref_Id IN (7392 ,2209 ) AND External_Order_Status.Order_Status_Txt = ('GenerationCompleted') AND Fee_Mapping_Definition.Document_Line_Series_Ref_Id IN ( 7789, 7788,7596 ) AND FEE_MAPPING_DEFINITION.DOCUMENT_TYPE_REF_ID = 1099 AND Document_Generation_Request.Product_Request_Id IN (SELECT PRODUCT_REQUEST.PRODUCT_REQUEST_id FROM Deal.Disclosed_Cost_Allocation, Deal.Disclosed_Closing_Cost, DEAL.External_Order_Request, DEAL.PRODUCT_REQUEST, Deal.Scenario WHERE Disclosed_Cost_Allocation.Disclosed_Closing_Cost_Id = Disclosed_Closing_Cost.Disclosed_Closing_Cost_Id AND Disclosed_Closing_Cost.External_Order_Request_Id = External_Order_Request.External_Order_Request_Id AND External_Order_Request.Deal_Id = Product_Request.Deal_Id AND product_request.scenario_id = scenario.scenario_id AND SCENARIO.SCENARIO_STATUS_TYPE_REF_ID = 7206 AND product_request.servicing_loan_acct_num IS NOT NULL AND product_request.servicing_loan_acct_num = 0017498379 --AND Disclosed_Cost_Allocation.Disclosed_Cost_Allocation_Id = 5095263 ) GROUP BY DISCLOSED_CLOSING_COST.DISCLOSED_CLOSING_COST_ID, External_Order_Status.Status_Updated_Tmstp, Reference_Data.Ref_Code, disclosed_cost_allocation.to_be_paid_amt order by 3 desc, 1 DESC); Result: 312 1302 1 2000 1304-1399 1 76 1303 1 312 1302 1 2000 1304-1399 1 76 1303 1 Required output: 312 1302 1 2000 1304-1399 1 76 1303 1 312 1302 2 2000 1304-1399 2 76 1303 2
Rod.Hey, Rod,
My guess is that you want:
, dense_rank () over (order by tmstp desc) AS rn
RANK means you'll jump numbers when there is a link. For example, if all 3 rows have the exact same last tmstp, all 3 rows would be assigned number 1, GRADE would assign 4 to the next line, but DENSE_RANK attributes 2.
"PARTITION x" means that you are looking for a separate series of numbers (starting with 1) for each value of x. If you want just a series of numbers for the entire result set, then do not use a PARTITION BY clause at all. (PARTITION BY is never required.)
Maybe you want to PARTITIONNER IN cd. I can't do it without some examples of data, as well as an explanation of why you want the results of these data.
You certainly don't want to PARTITION you BY the same expression ORDER BY; It simply means that all the lines are tied for #1.I hope that answers your question.
If not, post a small example data (CREATE TABLE and only relevant columns, INSERT statements) for all of the tables involved and also publish outcomes from these data.
Explain, using specific examples, how you get these results from these data.
Simplify the problem as much as possible.
Always tell what version of Oracle you are using.
See the FAQ forum {message identifier: = 9360002}Published by: Frank Kulash, August 1, 2012 13:20
-
Hello:
Some explain what are the functional differences and source of data between W_GL_BALANCE_F and W_GL_OTHER_F? The two seem to group by GROUP_ACCOUNT_NUM.
Thank you.It is not possible; all transactions in GL other eventually GL balance.
Both tables have essentially the same data but different grains. Two main differences:-Other GL have transaction log; GL balance make them summarized at the account level.
-Other GL is really additive since its transactions of individual entries. that is, you can just sum() any number of transactions and double counting used a trx; Balance of GL is a table of monthly snapshot. that is, it provides account balance for all accounts for the end of each month, so you can never add two snapshots. -
How to write the function or procedure to function 'Round' in oracle
Hello friends,
Last week I went to attend the interview. I asked a function, or a procedure to achieve the functionality of the 'Round' function in oracle manually. I couldn't reach it properly. Can someone let me know how I can do this? Is a mathematical idea behind it?
Thank you and best regards,
SBHello
create or replace
function my_round_fn (p_number in number, number of Round_Val)
Return number
is
whole v_round;
Start
v_round: = P_number * Power (10, Round_Val);
Return v_round / (Power (10, Round_Val));
end my_round_fn;It works in all cases.
Kind regards
Praveen
Maybe you are looking for
-
A matter of $ million I have a new W500 which should arrive soon, it is pre-loaded with Vista Ultimate, my current T42 has XP and all my applications run on XP, I have tested with a slow R backup series and were able to get 99% of my apps to work. Sh
-
Change the language of the LabView controls?
I just need confirmation. If LabView controls, as a graph, have a context menu, then this menu will be first in the language of the LabView IDE, it is used with. If I create a new application, then the manufacturer includes the LabView RTE. It will a
-
Smart way to propagate the IP address addy?
OK, so I got my wrp400 mostly working. The problem I am always face is that incoming calls always have an audio course. They can hear me, I can't hear them... so after a bit of research and testing and reading and manipulation, I found that it worked
-
Need help with Linksys WRT160N!
I had a Linksys WRT160N (version 1) for a few years. I plugged it on my desk, followed by a VOIP router and a cable modem. Internet through Comcast cable with typical 15 to 20 Mbps DL and around 4 Mbps UL (via Speedtest.net and Speakeasy). My only wi
-
How to give away / sell my HP safely (with HARD drive).
I was looking for and ask questions on the forums about upgrading my Hp to match my new game requirements. I decided to look into new technologies and to give or sell my current pc. I asked in another thread, that I should protect my information unti