I am trying to develop an ongoing interview schedule.
interviews may be held on FRIDAY, SATURDAY, TUESDAY or any other day or Days in a every week selected by the user and also at some specific time.
we need to schedule the closest comming day based on Application date.
for example: today is WEDNESDAY and our schedule interview day is FRIDAY and SUNDAY. If one application is received today we need to schedule interview on FRIDAY because this is the nearest/closest day of WEDNESDAY. and if the application is received on Saturday then of course Sunday will be scheduled.
if Application is received on same day e.g. FRIDAY is scheduled and we receive Application on FRIDAY then comes the concept of time. interview is schedules on FRIDAY 11:30 AM.
if application is received on before 11:30AM, the same day will be scheduled. If application is received after 11:30 AM then of course next closest day will be scheduled.
for a transaction that occured on 6/24/2012 after 6:00 AM the eff_date should be 6/24/2012 6:00:00.000000 AM and for a transaction before 6:00 AM on 6/24/2012 the eff_date should be 1/13/2012 12:00:00.000000 PM. and the transactions that occured before 1/13/2012 12:00:00.000000 PM the eff_date should be 1/11/2012 12:00:00.000000 AM and so on.
I would like to select test_sub.price as per the below conditions. If test_bb.value_date, test_bb.vehicle matches to test_sub.value_date,test_sub.vehicle then display test_sub.price
If there is no match then as above find the closest test_sub.value_date which is less than test_bb.value_date and select corresponding test_sub.price for the same vehicle combination.
begin insert into test_bb values(10,to_date('12-04-2012','dd-mm-yyyy')); insert into test_bb values(10,to_date('10-02-2010','dd-mm-yyyy')); insert into test_bb values(20,to_date('24-01-2014','dd-mm-yyyy')); insert into test_bb values(20,to_date('22-02-2008','dd-mm-yyyy')); end; /
begin insert into test_sub values(10,to_date('12-04-2012','dd-mm-yyyy'),2); insert into test_sub values(10,to_date('08-01-2010','dd-mm-yyyy'),4); insert into test_sub values(10,to_date('14-04-2014','dd-mm-yyyy'),6); insert into test_sub values(10,to_date('06-08-1947','dd-mm-yyyy'),8); insert into test_sub values(20,to_date('24-01-2014','dd-mm-yyyy'),10); insert into test_sub values(20,to_date('20-02-2006','dd-mm-yyyy'),12); insert into test_sub values(20,to_date('18-02-2004','dd-mm-yyyy'),14); insert into test_sub values(20,to_date('28-02-2006','dd-mm-yyyy'),16); insert into test_sub values(20,to_date('22-DEC-2007','dd-mm-yyyy'),19); end; /
I could write as below but I would like to know if there is a better way of doing it.
select bb.vehicle ,sub.price ,bb.value_date from test_bb bb ,test_sub sub where bb.vehicle=sub.vehicle [code].........
and user enters the figure like 13025now i would like to find the closest next value to the number entered by user, which is 713285 .how can i get this result, i have search a lot on Internet and i found some analytic functions can work out. but don't know how ..
I need to find the closest Date that matches a Particular Date. The Closest Date from the Group may be less than or greater than the Date I am trying to find.
I have two columns: VISIT_DATE and ACTUAL_DATE. The VISIT_DATE columns has many records with different dates while the ACTUAL_DATE column would only have one record per Student ID.
Here is an example of dates:
Visit Date Actual Date ========================== 01-APR-09 19-MAR-10 16-NOV-09 19-MAR-10 17-MAR-10 19-MAR-10 21-MAR-10 19-MAR-10 04-APR-11 19-MAR-10 15-JUN-11 19-MAR-10 19-SEP-11 19-MAR-10 24-FEB-12 19-MAR-10
The closest date to 19-MAR-10 are in fact 17-MAR-10 and 21-MAR-10. I would in that case need to pick up both records.
Z1575560 15/06/2008 29/07/2008 44 Number of Days Z1575560 15/07/2008 29/07/2008 14 Number of Days Z1575560 21/11/2008 27/12/2008 36 Number of Days Z1575560 17/12/2008 27/12/2008 10 Number of Days
Problem:
For 1st and 2nd row,
I am getting 29/07/2008 as a.p_date for both 15/06/2008 and 15/07/2008 which is wrong in my scenario. This is because data is missing in the second table for row 1 (similarly for row 3). So What I want is :
Z1575560 15/06/2008 Z1575560 15/07/2008 29/07/2008 14 Number of Days Z1575560 21/11/2008 Z1575560 17/12/2008 27/12/2008 10 Number of Days
Say for eg: a person is in city A. He is departing on (15/06/2008 ) and arriving on 29/07/2008 and again departing on 15/07/2008 which is not possible.
It should be departing on (15/06/2008 ) and arriving between 15/06/2008 and 15/07/2008 (missing data hence null is required here) and departing on 15/07/2008 and arriving on 29/07/2008 .
Quote: I have a table(table name is names) with column as name(varchar) . I have the following data for name column.
Miss Mississ Mississipp
I would like to find a nearest match for Mississippi, that means sql should return row that contains Mississipp( Row #3)
If I try to find nearest match for Mississirr then sql should return row that has column value Mississ (Row#2) Is this possible ? Here is the code for table creation and data.
create table names (name varchar2(20));
insert into names values('Miss'); insert into names values('Mississ'); insert into names values('Mississipp'); commit;
I'd like to select one of two fields from a table, based on which of them is greater for that row.
e.g. For every row in JOINING_TBL, I'd like to select either JOINING_DATE or REJOINING_DATE, whichever is greater. I do dream about being able to use a Java-like ternary operator in here, something like this:-
SELECT (JOINING_DATE>REJOINING_DATE?JOINING_DATE:REJOINING_DATE) FROM JOINING_TBL
However, I understand(through other fora) that this can't be used in here.
i have a parameter form where user will input from item to item and items within this range will be come as output , but i want an option to select the random items from the list, like i may not select all the items from 1 to 10 , but instead i want to pick or select randomly , i may opt for 1,3,4 and 7.
Our term (strm) is dictated by the term_begin_dt and term_end_dt dates but I want to keep selecting that term until 1 week before the next term opens and then switch to that term.
Basically, I don't want any gaps between a term.
Output:
select strm when sysdate is between term_begin_dt and term_end_dt (strm would equal 3943) select strm until 1 week before the start of the next term (4027) (strm would equal 3943) select strm when 1 week before term_begin_dt (strm would equal 4027)
Repeat for the next term and so on 12/16/2011 select strm from term where trunc(sysdate) between trunc(term_begin_dt) and trunc(term_end_dt)
Output: 3943 12/17/2011 - 01/01/2012
select strm from term where ?
Output: 3943
01/02/2012 - 5/4/2012 select strm from term where ?
Output: 4027
Repeat.
Test Case:
CREATE TABLE TERM ( STRM VARCHAR2(4 BYTE), DESCR VARCHAR2(20 BYTE), TERM_BEGIN_DT DATE, TERM_END_DT DATE )
Insert into TERM (STRM, DESCR, TERM_BEGIN_DT, TERM_END_DT) Values ('3943', '2011 Fall Semester', TO_DATE('08/22/2011 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('12/16/2011 00:00:00', 'MM/DD/YYYY HH24:MI:SS')); Insert into TERM [code].....
I have a question regarding a selection limit from a list of values. The table where my IDs (unit_codes) come from has another column called 'points'. each ID has its own number of points. Is there a way to put a selection limit on the display field that points will be placed on?
FOR EXAMPLE: a course block has a selection limit of 70 points, A person named someguy selects : music = 20 points maths = 20 points mathsXTRA = 40 points **ALERT!!! - U can ONLY select 70 points worth of units**
I've got a Source Data in complex relational formFor reporting purposes, a simpler, less normalized data model is neededThere are two Target views from the Source Data: one of them with full access to all datathe second one with access only to a subset of the data (same columns, but not all the records)For both target groups, a separate schema shall be available, each containing only relevant dataToday, these schemas are physically located on the same DB instance and host as the source dataA daily refresh is sufficientA later relocation of the reporting schemes to other DB instances shall be possible without major changes neededOracle 10g should be used I tried to accomplish this using Materialized Views (Materialized seems better since there will be sometime a need to have all the apropriate data somewhere else, geographically, AND it provides Complete Refresh from the Source), but there is a problem: when creating the MV there is a possibility to type 'SELECT *' - but after execution it changes into real columns names. It is important because later after adding a new column into Source Data it WILL NOT appear in MV after refresh.
I also thought about Data Guard, Streams and RAC, but I think only in the Materialized Views you may choose the data to show (rows, columns).
i am facing a problem in functionality of a form as there are different search parameters: date from: text item-->mandatory date to: text item---->mandatory house type: list item-->optional form_status: list item->optional order by: list item---->optinal
untill i don't select house type by list item everything is working fine and gives desired result, even with house type if i select any house type result is fine but as i select last list item of house type which is null as i want result without house type then it gives no any data as data is present in database.
for example: date from: 20-05-2009 date to: 21-05-2009
with these two i got the correct result, then i select house type: 3
i got the correct result and when i change list item to any value like: 1,2,3.....it is working fine but as i want result without house type by selecting the null value in list item as: date from: 20-05-2009 date to: 21-05-2009
it is not picking any data from database. but the same search criteria in 1st case as i described above giving result. declare qry varchar2(5000); n number; alert number;
I have a requirement to select multiple values from a list item and do some manipulations with those values. I tried by integrating the LOV with a text item, but couldn't able to select multiple items. Is there a way to do multiple selection in a list item ?
I have created three accordians where there will be sub tabs under each Accordian. There will be two logins. Where when i login with Admin all the 3 accordians will be shown. But in the user logins 1st Accordian will be hidden and only 2nd & 3rd will be shown with their sub tabs.
In order to highlight the tab & also for Accordian to be open based on the selection, i wrote code as follows
in the page under the Execute When Page Loads region where ('activate',0) means the position of the accordian which will be taken as 0,1,2..etc.But when i login as user then as the 1st accordian will be hidden & the 2nd and 3rd accordians will become 1st & 2nd. So 1st & 2nd accordian wil be consider as 0,1 positions here.
So when i click on the 2nd accordian tabs then the accordian is not opening because in the pages of this accordian tabs i have given the code as
as the active is 1 so the accordian in position 1 is opening but i want the accordian in 0 position to be opened as i selected the tab under that accordion only.
We have a master detail form with report that inserts the details in both region/ sub region.
However our requirement is that in sub region we have a LOV to chose the service, and each service has a price. How can we populate the Price column based on the selection of the Service? There are some similar posts but we cannot apply to our form.
I would like to populate a text box based on selection from a LOV. If someone selects a LOV value and then tabs off off of that element, I would like the text box populated from a sql statement based on the LOV value in the predicate.Application Express 4.1.1.00.23
I have created the below stored procedure and calling the procedure in when-button-pressed trigger. Problem here is that when I cancel the file selection in file open dialogue box its raising exception.
PROCEDURE TEST IS buffer_lines client_text_io.file_type; v_outputstr VARCHAR2 (32767); p_delimiter VARCHAR2 (10) := '","'; v_transaction_no VARCHAR2 (10); BEGIN [code].......
I have two databases (say DATABASE 1 with user USER1 with table A and DATABASE2 with user USER1 with table A). I want to select the table A in USER1 DATABASE2 from DATABASE1 USER1.
Need to create a report based on date ranges and for this created a interactive report and two page item datepicker fields P15_fromdate and p15_todate. Report works fine with this criteria.But user wants one more field quarter(P15_quarter), When they select the quarter the range values has to get reset and as to get applied to report.
Issue here is unable to find a way to set the page range item values based on the quarter field selection