SQL & PL/SQL :: Function To Calculate The Vacation?
Oct 31, 2011
how can create function to calculate the vacation example if i takes 10 days vacation and Friday , Saturday only a normal vacation but The rest of the days is Within the vacation
how can calculate the vacation and make this function dynamic such as when takes the vacation 1-1-2011 and number of days vacation 10 not including the Friday, Saturday days
I created a PROCEDURE in that i am calling function which calculate sum of salary...I just want Output in format for that which function i need to use...?
Actual Output:::
DEPt_Name SALARY ACCOUNTING 8750 RESEARCH 10875 SALES 11600
I want Output in well alignment column...i WANT Output IN column format but my output in not geting in that format...Is there any function to align output...I want Output in well alignment column
create or replace function getDate(p_joing_date Date,p_sysdate) Return Date; IS v_compltd_mnths; BEGIN SELECT into v_compltd_mnths MONTHS_BETWEEN(TO_DATE('sysdate','MM-DD-YYYY'), TO_DATE('joing_date','MM-DD-YYYY') ) "Months"FROM DUAL; return v_compltd_mnths; END;
I can easily calculate the standard deviation for some rows with the STDDEV function. But that returns me a value expressed in the same units as the things being measured. (In other words, if I have times of 1,12,6,11 and 8 seconds, I will be told that the average time is 7.6 seconds, and the standard deviation is 4.39 seconds).
What I'd like to be able to do is to say that the record with value 1 is (say) 3 std deviations away from the average. Or that the 6 second row is within 1 standard deviation.
I am trying to find records which are more than 3 standard deviations of the mean, because they are the outliers I am interested in.
I cannot see how to convert a STDDEV result into being a "number of standard deviations".
(If I have not expressed myself clearly, I'm using this sort of stuff URL....and I'm trying to find >3-sigma records)
simply to multiply the STDDEV result by 1, 2, 3 and so on, and then compare to the time? That is, is it OK to do the following:
Mean = 7.6 seconds (from my sample data mentioned in the above post) StdDev = 4.29 seconds
So 2sigma would be 4.29*2 = 8.78 seconds, plus or minus the mean?
So any record with a time value between -1.18 (7.6-8.78) and 16.38 (7.6+8.78) seconds would be within 2-sigma, assuming normal distribution?
I am still wondering if there's a nice function or something that returns the sigma value for any given set of records?
I want Oracle stored function/procedure to calculate number of working days between two dates. We need to exclude Firdays and Saturdays as there are weekend holidays and also exclude official holidasy that lie between two dates.
I am trying to calculate pay with a package which consists of four functions for calculations and a procedure that calls the functions to calculate net pay.
DML DDL and package
I the DML and DDL and the package as an attachment.
Problem
Errors below
32/9 PLS-00103: Encountered the symbol "E" when expecting one of the following:
, ; for group having intersect minus order start union where connect The symbol "having" was substituted for "E" to continue.
32/54 PLS-00103: Encountered the symbol ")" when expecting one of the following:
LINE/COL ERROR -------- ---------------------------------------------------------------- . ( * @ % & - + ; / at for mod remainder rem <an exponent (**)> and or group having intersect minus order start union where connect || multiset
33/9 PLS-00103: Encountered the symbol "INTO" when expecting one of the following:
. ( ) , * @ % & = - + < / > at in is mod remainder not rem <an exponent (**)> <> or != or ~= >= <= <> and or like like2 like4 likec between || member submultiset
How to calculate exact age for example my date of birth is 10-04-1972 and today current date is 21-10-2011 so i want to calculate age how many years, how many months and how many days.
I need a query to find out the working days. I have attached the sample script to create table and data. Here is the description of the tables.
Emp1 : To record the employe's information and weekly rest day. Attendance :- To record daily attendance. Leave_appovd : To record the approved leaves. Holiday : To record the holidays.
W = Attendance R = Weekly Rest L = Leave H = Holiday A = Absent
My requirement is; I what create new table/view which contains all value of both table and new column called Total Amount. Total amount=SUM(Quantity*Unit_Price+Central_sales_Tax+Service_Tax+ValueAdd_Tax+Entry_Tax+Professional_Tax)
Percentage will be calculated as rtons of code not having first digit 0 devided by itons having having code 0 result multiply 100 for the same date code wise e.g. For dated 17-jul-13 meal percentage will be calculated as round((104.304/193.155)*100,3)=54.000
How To Calculate Average in Forms 6i for example a summary column named (Amount = 5000) and i want to calculate 15% average of this amount i want to calculate it like summary column .
--How to calculate START_PERIOD_DATE and END_PERIOD_DATE for every time insert reocrd, like for 4 cases? --I need to check start_date with last period date for same employee.
And based upon calculate START_PERIOD_DATE and END_PERIOD_DATE,,,,,
I want to calculate time difference b/w two time clocks, just like we calculate the date difference and answer is in days, In the same way i like to have answer in hrs,min and ss.
SELECT Sum("F0902"."GBAPYC"/100) AS "initialBalance", Sum("F0902"."GBAN01"/100) AS "January", Sum("F0902"."GBAN02"/100) AS "February", Sum("F0902"."GBAN03"/100) AS "March", [code]....
how do w calculate sum in a form? for example in datablock sale, I have few rows of data, i want to calculate the total of product purchased (column totitem) and , sum of the customer have to pay. (totalprice). how to do the calculation in a program unit?
We have a table which contains the outage data as below,
TAG CI_NAME OUTAGE_START OUTAGE_END IM10366 FD0004 06-jul-2010 10:00:00 10-jul-2010 10:00:00
so from the above record, the outage is from 6th - 10th July. So for the given TAG & CI_NAME, we have to calculate the outage for day. So the above record should be split as below
I want to calculate two parameters A and B which are interdependent. Unfortunately, my code is not working correctly:
create table temp_res1 as select * from temp_res model dimension by (rn) measures ( 0 as A, 0 as B
[code]....
The correct result should be:
create table temp_res (rn integer, a integer, b integer); insert into temp_res values(1, 5, 10); insert into temp_res values(2, 11, 6); insert into temp_res values(3, 7, 12); insert into temp_res values(4, 13, 8); insert into temp_res values(5, 9, 14); insert into temp_res values(6, 15, 10); insert into temp_res values(7, 11, 16); insert into temp_res values(8, 17, 12);
but I get:
create table temp_res (rn integer, a integer, b integer); insert into temp_res values(1, 5, 10); insert into temp_res values(2, 11, 6); insert into temp_res values(3, 1, 12); insert into temp_res values(4, 1, 2); insert into temp_res values(5, 1, 2); insert into te
first table employees emp_no pk emp_name emp_salary emp_hiredate emp_birthdate ------------------- second table sanctions sanc_id sanc_name emp_no fk
i need the following
if employees take sanctions and his salary 1000 and sanctions value 50 then the net salary is 950 . I need if the same employee take another sanctions values 50 the result will be the old net salary is 950 and the new old salary is 900
My applications is integrate with Excel 2003 by Ole2 package. Some of them excel books are using functions activates with Excel Complements (activate with men options: Tools-Complements-Analyisis Complements and Analysis complements VBA).
The problem is when I invoke this excel book in Oracle Forms, this functions don't work.
I have to procedure that computes number of project, and average working hours of employees where employee id is passed as a parameter to the procedure. If the average working hours is less than 10 then employee's salary remain the same, otherwise check if number of project is less than 4 then 5% of salary, else 10% of salary is added to the salary.
I need to subtract multiple numbers to get the difference between each numbers, the amount of numbers to subtract between each others can vary between 2 and 10.
during application migration, i got one table from MS Access, and have situation where two events are splited into 4 columns (start: date1 time1 and stop: dat2 and time2). How to properly calculate duration between these two events, and show it in format: hh:mi ?
Is there any function avaialble in SQL that can return the highest common factor among a bunch of numbers. For example 10,20,25 have a highest common factor of 5.