Error definition day LOV based on the month and year
Select ' 1 ', ' 01' day_aff union double val...
Select '29', ' 29 "double where '29' < = to_char (last_day (to_date ('01.' |)))" '02'. '.' || (((', 'dd.mm.yyyy')), 'jj') union
Select '30', ' 30 "double where '30' < = to_char (last_day (to_date ('01.' |)))" '02'. '.' || (((', 'dd.mm.yyyy')), 'jj') union
Select '31', '31' from dual where '31' < = to_char (last_day (to_date ('01.' |))) '02'. '.' || (((', 'dd.mm.yyyy')), 'jj')
order by 2
That works well.
If I replace '02' by: P10_MONTH & P10_MONTH. or v ('P10_MONTH') and 2008 by: P10_YEAR & P10_YEAR. or v ('P10_YEAR'), I get the following error on the creation of LOV (in shared components or LOV section of the element):
LOV query is not valid, a display and a return value is needed, the column names must be different. If your query contains a query online, the first CLAUSE in the SQL statement must not belong to the query online.
No work around?
Igor
Hi Igor,.
I think it's the | in the SQL that is causing the problem. You can get around this by the presence of a hidden page element which is calculated at the point of process before header which calculates the first day of the selected month.
I did it on this page: [http://apex.oracle.com/pls/otn/f?p=35917:16]
In addition, you can simplify your SQL statement to something like:
SELECT LEVEL d, LEVEL r
FROM DUAL
CONNECT BY LEVEL <= TO_NUMBER(TO_CHAR(LAST_DAY(TO_DATE(v('P16_FIRSTDATE'),'DD/MM/YYYY')),'DD'))
(P16_FIRSTDATE is the element that contains the calculated date)
Andy
Tags: Database
Similar Questions
-
Get the number of days in a month based on the month and year of fields
I have a column in my form which lists the days in a month. I want to configure a hidden field that calculates the total number of days in a month, based on the month and year of the field inputs. The number of days will determine what appears on the column. For example, if I put 4 months, and 2016 in the field of the year, I get 30 in the hidden field. Thus, on the column 'Day', I'll have numbers 1-30. Or if I put 2 months and 2016 in the field of the year, I get the 29 in the hidden field. If the numbers 1-29 appears in the column 'day '.
Found this on some forum javascript code:
//Month is 1 based
function daysInMonth(month,year) {
return new Date(year, month, 0).getDate();
}
//July
daysInMonth(7,2009); //31
//February
daysInMonth(2,2009); //28
daysInMonth(2,2008); //29I do not know how to convert this code in JavaScript to adobe and don't really know how to use it. All I know how to do is to configure the field values for the field month and year as variables. I am a novice programmer and would appreciate it really all the help I can get. Thank you in advance!
The code seems to be JavaScript and runs as needed by using the JavaScript console.
I would like to consider making more general code, so if you have a date string that includes at least the month and year we could just call the function and get the number of days for that month.
The following script will calculate the number of days in a month, by using at least the month and year values can display the result on the JavaScript console and all of the value field for the field that has this code as the custom calculation Script.
function daysInMonth (oDate) {}
return new Date (oDate.getFullYear (), oDate.getMonth () + 1, 0) .getDate ();
}nMonth var = this.getField("Month").valueAsString; get the value of month;
nYear var = this.getField("Year").valueAsString; get the value of the year;Event.Value = "";
If (nMonth! = "" & nYear!) = "") {}
var MyDate = util.scand ("' / mm/yyyy ', nMonth +" / "+ nYear); convert to date object;
var nDaysInMonth = daysInMonth (MyDate); get the number of days;Console.Open (); Open the JavaScript console;
Console.clear(); clear the console;
Console.println ("Days in" + nMonth + ":" + nDaysInMonth); show days in month;
Event.Value = nDaysInMonth; Set the value of the field;
}
-
get the month and year of date type
Hi all
I need to get the month and year of type date.
For example
Required result:select to_date('2011-01-17', 'yyyy-mm-dd') from dual;
Any ideas?01-2011
Thanks in advance,
Bahchevanov.select to_char(to_date('2011-01-17', 'yyyy-mm-dd'),'mm-yyyy') from dual;
HTH
-
to get the month and year separated
Hello
I have the entry_date_fin of column (type of data-varchar2 (8))
with values like Apr.-2008
Feb-2009 etc.
can I get the distinct month and year separated
kindly guide mei tried select to_date(entry_date_fin,'MM') FROM xyz doesnt wrk
Although you are (wrongly, IMO) storage of dates as strings, just use string manipulation...
SQL> with t as (select 'FEB-2008' as txt from dual) 2 -- 3 select substr(txt,1,3) as mnth 4 ,substr(txt,5) as yr 5 from t 6 / MNT YR --- ---- FEB 2008 SQL>
-
Hide the 0 before the month and year
I m using this query to generate the sequence
The result isSELECT TO_CHAR (SYSDATE, 'MM') || TO_CHAR (SEQ.NEXTVAL) || TO_CHAR (SYSDATE, 'YY') FROM DUAL;
06 is the month0612109
121 is the sequence
09 is the year
I want to hide 0 before the month and the year also.
Looks like this
* 61219 *.if here Month is 10 and year is 2010 then It will display 1021110
Try this
SQL> SELECT ltrim(TO_CHAR(to_date('12-10-2010','dd-mm-yyyy'), 'MM'),'0') 2 || TO_CHAR (SEQ.NEXTVAL) 3 || ltrim(TO_CHAR (to_date('12-10-2010','dd-mm-yyyy'), 'YY'),'0') format_date 4 FROM DUAL; FORMAT_DATE -------------------------------------------- 1026010
-
Today's date in the month and year
Dear experts,
I have a year and the number of the day, I wanted to identify the date
ex: number of days = 203 year = 2009
Date: 22/07/2009
Please advice the best way possible to achieve.
Thank youDear user!
Please try this code.
SELECT TO_DATE(2032009, 'DDDYYYY') as dateval FROM dual; DATEVAL ------------------- 22.07.2009 00:00:00
This figure first three are the day number and the last four digits are the year. The DDD format will give you the day and the month as JJ.MM. YYYY format join the year your date. To do this, try:
SELECT TO_DATE(2032008, 'DDDYYYY') as dateval FROM dual; DATEVAL ------------------- 21.07.2008 00:00:00
Yours sincerely
Florian W.
Published by: Florian W. the 22.07.2009 08:40
-
How to find the sum of the month and year of a date
Hi all
I want to find the sum of the date
for example, 10 November 2010 I need to find (11-2010).
Please help meYou can use the extract function...
SQL> select extract(month from systimestamp)+extract(year from systimestamp) from dual; EXTRACT(MONTHFROMSYSTIMESTAMP)+EXTRACT(YEARFROMSYSTIMESTAMP) ------------------------------------------------------------ 2021
Concerning
Renjith Malet -
problem to insert only month and year instead of the full date
Hi, can someone help me how I can register only the month and year of the value which have full day in the database?select b.penjara_id, p.penj_lokasi, a.no_daftar, b.episod, b.nama1,to_char(a.trkh_mula_prl,'dd/mm/yyyy') as trkh_mula_prl, to_char(bulan_proses,'mm/yyyy') as bulan_proses, b.epd, b.lpd from prl_daftar_proses a, senarai_pesalah b, penjara p where a.no_daftar=b.no_daftar and a.episod=b.episod and b.penjara_id = p.penjara_id and a.setuju_jplp is null and a.bulan_proses between to_date(:FROM,'dd/mm/yyyy') and to_date(:TO,'dd/mm/yyyy') order by b.penjara_id, a.bulan_proses,a.no_daftar
for example, the date is 18/09/2012, but I want to just insert 09/2012 as a parameter. If I want to insert only one setting, I can do... But I have problem when I want to insert two parameters...Lina saleh wrote:
I already try before that and he invites me error like this...
"name of the invalid host/identification variable.Change the name of the connection variable to: from_date and: to_date
Is a reserved keyword.
-
How to set the filter criteria for the month and the year to aid in the timestamp input field?
Hello
I use jdev 11.1.2.3.
I have a problem with the generation of reports, I have a report table that is in the form of VO (query based) and I want to search this table in the month and year of the basic
but in this table (query) This timestamp field of having value based on... How to do a search with the name of the month and year only... Here I totally use vo base query to generate a
reports... Anyone can guide me.
Thank you.
I want to create a drop-down list for month + year as an executable parameters with bind variable no matter what idea this subject, my attribute here is TimestampFormat.
Then add to your sql query something like:
WHERE extract (your_timestamp_column MONTHS) =: monthBindVar
OR an extract (YEAR your_timestamp_column) =: yearBindVar
and add monthBindVar and yearBindVar as a bind variable to your view object.
Then you can use it as a ExecuteWithParams operation (or manually set these bind variables and execute the query)
Dario
-
2 definitions of view based on the value of the table
Hi all
Is it possible to have 2 different definitions of each entry of 2 base tables display different, based on the value of the table?
We have 2 tables with similar columns, one with historical and other data was only the latest / greatest according to yesterday (it is populated by ETL from mainframe). Changes made by the java application online is now going into the table containing historical data immediately, but edits made in mainframe comes to the table with the data current next day.
There are 2 products, an is based on the last and largest of the historical table based on cre date and date of mod and other product relies on the table with the current data (not historical).
Tried using joins for these two tables but the performance wasn't good and each product needs table data alone, and so I wanted to eliminate joins.
We wanted to use the same name for the view from the metadata using the shared functionality based on the name of the view.
Is there a way define a view under certain conditions?
It is:
If the value for a particular parameter is 0 then
Select c1, c2, c3 of < historical table > other
Select c1, c2, c3 of < no history table >
Any ideas?You are looking for something like this?
Re: how to pass parameters in a view -
I want to collect rain for the day, month and year; Can what formula I use?
I want to collect rain for the day, month and year; What formula or expression that I can use.
I use a Rain Wise product that converts impulses to an analog value. The rain wise device can be
"the value measure up to 1", 5", or 10". I will be setting the unit at 10 inches in increments of 0.01 inch.
What I would do is at each time increments of signal I would consider it as 0.01 then after reaching
a period of time a day or a month, back to zero.
Need some advice on this problem.
How about you, using a counter to count the number of times where the signal is less than 0.01?
For example,.
Counter.Count = signal<=>=>
The total number of rain is
Counter * 10 + signal
Use TimeOfDay or TimeOfWeek to reset the counter.
-
Update error... I tried to update for the month and each time it fails
I tried to perform updates for the month and each time it fails. I get the same error message... Code 646 WIndows has encountered an unknown error. I did troubleshooting and you are unable to find assistance. I don't know much about the workings of the computer, but I know that I should be able to perform these updates. I think I need it too. I have 9 at this stage that it cannot load. Help, please!
I tried to perform updates for the month and each time it fails. I get the same error message... Code 646 WIndows has encountered an unknown error. I did troubleshooting and you are unable to find assistance. I don't know much about the workings of the computer, but I know that I should be able to perform these updates. I think I need it too. I have 9 at this stage that it cannot load. Help, please!
This link leads to a response from Bobby Mi, moderator.
Date: July 6, 2010
http://social.answers.Microsoft.com/forums/en-us/vistawu/thread/18449f60-C149-4EAF-B8E6-a2880cd7232bBobby Mi response will lead to this tutorial from Microsoft Support:
http://support.Microsoft.com/kb/2258121Hope this can help solve your problem.
For the benefits of others looking for answers, please mark as answer suggestion if it solves your problem. -
Set the calendar to display day, month and year
In addition to the time of day, my computer began giving the day of the week (Monday) only instead of day, month and year as it did before. Tried to go back to 29/12/2014 or something similar without success. Any suggestions?
Hello
Sorry for the late reply and I appreciate your patience.
User profile corruption might have caused the problem. As a solution, I suggest to create a new user profile and check if the date format displays the same thing.
To do this, see the link below.
http://Windows.Microsoft.com/en-us/Windows/fix-corrupted-user-profile#1TC=Windows-7.
It will be useful. Just answer us with the State, and we will be happy to help you.
-
To find the months and days between 2 dates
Hello
I want to find the months and days between 2 dates.
For example.
1 - Date: August 25, 2013
2 - Date: October 23, 2013
If we consider each month 30 days, it should give
August 25, 2013 to August 30, 2013 = 6 days
01-Sep-2013-30-Sep-2013 = 1 month
October 23, 2013 to October 30, 2013 = 8 days
Total = 1 month and 14 days.
Kindly help as soon as possible.
Thanks and greetings
Suresh
Assuming that d2 > d1,.
where d)
Select sysdate d1, sysdate + 56 double d2
Union all select to_date (March 1, 2013 ',' dd-mon-yyyy "") d1, to_date (March 31, 2013 ',' dd-mon-yyyy ') d2 double
Union all select to_date (5 February 2013 ',' dd-mon-yyyy ') d1, to_date (March 31, 2013 ',' dd-mon-yyyy "") double d2
Union all select to_date (February 25, 2013 ',' dd-mon-yyyy "") d1, to_date (March 23, 2013 ',' dd-mon-yyyy ') d2 double
Union all select to_date (February 25, 2013 ',' dd-mon-yyyy ') d1, to_date (March 31, 2013 ',' dd-mon-yyyy "") double d2
Union all select to_date (August 2, 2013 ',' dd-mon-yyyy "") d1, to_date (29 October 2013 ',' dd-mon-yyyy ') d2 double
Union all select to_date (February 1, 2013 ',' dd-mon-yyyy "") d1, to_date (May 31, 2013 ',' dd-mon-yyyy ') d2 double
Union all select to_date (25 August 2013 ',' dd-mon-yyyy "") d1, to_date ('03-Sep-2013', 'Mon-dd-yyyy') d2 double
Union all select to_date (July 30, 2013 ',' dd-mon-yyyy "") d1, to_date (August 31, 2013 ',' dd-mon-yyyy ') d2 double
Union all select to_date (July 31, 2013 ',' dd-mon-yyyy ') d1, to_date (August 30, 2013 ',' dd-mon-yyyy "") double d2
Union all select to_date (July 31, 2013 ',' dd-mon-yyyy ') d1, to_date (3 August 2013 ',' dd-mon-yyyy "") double d2
Union all select to_date (3 July 2013 ',' dd-mon-yyyy "") d1, to_date (August 31, 2013 ',' dd-mon-yyyy ') d2 double
Union all select to_date ('31-08-2013', ' dd-mm-yyyy'), to_date('05-10-2013','dd-mm-yyyy') of the double
Union all select to_date ('05-02-2013', ' dd-mm-yyyy'), to_date('31-03-2013','dd-mm-yyyy') of the double
Union all select to_date ('05-02-2013', ' dd-mm-yyyy'), to_date('05-03-2013','dd-mm-yyyy') of the double
Union all select to_date ('05-02-2013', ' dd-mm-yyyy'), to_date('05-02-2013','dd-mm-yyyy') of the double
)
Select d1, d2,
1 + 30 * trunc (months_between (d2, d1)) + LESS (extract (day of d2), 30)-LESS (excerpt (d1 day), 30)
+ CASE when extracted (d2 day)< extract(day="" from="" d1)="" then="" 30="" else="" 0="" end ="">
d
D1 D2 DAYSBETWEEN
----------- ----------- -----------
October 10, 2013 5 December 2013 56
March 1, 2013 30 March 31, 2013
5 February 2013 March 31, 2013 56
February 25, 2013 March 23, 2013 29
February 25, 2013 March 31, 2013 36
August 2, 2013 29 October 2013 88
February 1, 2013 may 31, 2013 120
August 25, 2013 03 - Sep-2013 9
July 30, 2013 31 August 31, 2013
July 31, 2013 August 30, 2013 31
July 31, 2013 3 August 2013 4
July 3, 2013 August 31, 2013 58
31 August 2013 5 October 2013 36
5 February 2013 March 31, 2013 56
5 February 2013 March 5, 2013 31
February 5, 2013 February 5, 2013 1
In my view, which corresponds to your rules.
-
Get the number of days, months and year
Hi all
I'm using OBIEE 11 g. I have a line of dash for year (2010, 2011, etc.) and months (Jan, Feb,..., Dec). How can I get the number of days in a given month and year in my report?
For example, if I choose to Jan & 2011, I'd get 31 and 356. And if I choose Feb & 2011, I would get 28 and 356.
Thank you!I have something more good option here... Try to use this
DAYOFMONTH (TIMESTAMPADD (SQL_TSI_DAY, DAYOFMONTH (CURRENT_DATE) *-1, TIMESTAMPADD (SQL_TSI_MONTH, 1, CURRENT_DATE)))
This will give you the days for the month in progress (Oct 2011) after calculating the last day of each month... Similary dynamically pass the value Date or month... You will need to modify this function but shud be simple. Hope this helps :)
Maybe you are looking for
-
What operating system I use for iPhone 4?
What operating system I use for iPhone 4? It will work with OS 9?
-
How to fix my computer hp Pavilion laptop? I clicked the button refresh settings, I was afraid of losing my files so I turned it off when updating. And now it won't start. I tried pressing f10 but I don't know what to do. Can you help me?
-
Windows Live Mail 080048849 error
WLM gives me this message regularly, it stop sned/receive all messages - sometimes for a linked account, sometimes more than one. If I go directly to thiose accounts I can get my mail - but not through WLM. It is very annoying. Note that the already
-
LaserJet 1012 - Duplex/duplex printing is no longer
I'm under the version 2.00 driver LJ1012 and Mountain Lion. The duplex on the LJ1012 function is a manual feeder. When I bring up the print dialog box, the option to print on both sides is grayed out. I went to the tab uner the printer driver, but
-
Hello, I use Lightroom 5.7 on a single PC. Now, I use LR on the cloud (subscription).I'm not shure on my Installation on my PC - will all the settings and Plugins on my PC available after the update to LR6 CC (in the cloud)?For example, I share my ra