Convert number of dayes per year
Please I need help to convert many dayes so farI have ID as id
FT * 09025 * 0000000001 date = 20090125
FT * date 01171 * 0000000002 = 20100620
therefore must convert number five after FT as from the
example * 09025 *.
map 09-2009
025 dayes annually number card to 25 jan
example * 01171 *.
01 card for 2010
map number 171 of dayes annually to 20 jun
(jan + Feb + March + April May) (31 + 28 + 31 + 30 + 31) = plus 151
171-151 = 20 for next month
Please need help will be so added filter to informatica card with date
Published by: user8929623 on July 4, 2010 19:04
Well, I'm not why when 09 maps to 2009, 01 maps to 2010, not in 2001. Assuming that it should be 2001, use YYDDD format:
SQL> with t as (
2 select 'FT*09025*0000000001' id from dual union all
3 select 'FT*01171*0000000002' from dual
4 )
5 select to_date(substr(id,4,5),'yyddd') dt
6 from t
7 /
DT
--------
20090125
20010620
SQL>
SY.
Tags: Database
Similar Questions
-
Please suggest how to convert number of days, months, years
Dear all,
I have a requirement, where to get a value of function, say 61 (in days).
I want to display it in the report as, (60/30 + 1)
Years months days
0 2 1
Please suggest.
Thanks in advance.
Kind regards
Afzal.
You could act as some sort of an astronomer: year - Wikipedia, the free encyclopedia
Select: days of entry,
floor (: days/365.25) years.
Floor (mod(:Days,365.25) / (365.25 / 12)) months.
ceil (mod (: days, 365.25/12)) days
of the double
but do not be surprised
DAYS YEARS MONTHS DAYS 731 2 0 1 730 1 11 30 366 1 0 1 365 0 11 31 364 0 11 30 92 0 3 1 91 0 2 31 90 0 2 30 62 0 2 2 61 0 2 1 60 0 1 30 32 0 1 2 31 0 1 1 30 0 0 30 1 0 0 1 Maybe the next version is more beautiful
Select the days,
Floor(Days / 365.25) years.
Floor (mod (Days, 365.25) / (365.25 / 12)) months.
round (mod (days, 365.25/12)) days
periods
DAYS YEARS MONTHS DAYS 731 2 0 1 730 1 11 30 366 1 0 1 365 0 11 30 364 0 11 29 92 0 3 1 91 0 2 30 90 0 2 29 62 0 2 1 61 0 2 0 60 0 1 30 32 0 1 2 31 0 1 1 30 0 0 30 1 0 0 1 Concerning
Etbin
-
Dear members,
I was provided with the date range.
I want to calculate the no. day of each month, within the range of dates above.
e.g. date1 = October 1, 2011' and date2 = 18 March 2011"
for month = 01 number days = 22
for month = 02 number days = 28
for month = 03 number days = 18
Thank you
teefu
DeveloperSQL> select to_char(dt, 'mm') month 2 , count(*) count_days 3 from ( select to_date('10-01-2011', 'dd-mm-yyyy') + level -1 dt 4 from dual 5 connect by level <= to_date('18-03-2011', 'dd-mm-yyyy') - to_date('10-01-2011', 'dd-mm-yyyy')+1 6 ) 7 group by to_char(dt, 'mm'); MO COUNT_DAYS -- ---------- 01 22 02 28 03 18 SQL>
-
Count of the number of days in a calendar month according to the year
Hi all
On my table, column 1 is the list of months over several years.
Column 2 is the activity number od each month.
Column 3 I want an average rate of activity per day during the month, which should be: (C2 / number of days according to C1) %
Problem: I can't find a fomula give me the number of days, particularly in February when the year is leap.
Any help is appreciated.
Thank you all,
Lopez
PS: by the way, with this new version of Apple Comunity I seem to have lost my previous questions about the numbers.
Hey Lopez,
EOMONTH(A1,0) (end of month) will GET help you.
Column B is Date & time format to display only the month and year (actually the 1st of the month, but the day is not displayed).
Formula in C2 (fill down)
= EOMONTH(B2,0)
The end of the month 0 months later.
Formula in D2 (fill down)
= DAY (C2)
February 2015 (non-leap years) shows 28
February 2016 (leap year) shows 29
Kind regards
Ian.
-
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;
}
-
Procedure for the number of working days per month when the user enters to and from everyday
Hi all
Can provide you a solution to this - procedure for the number of working days per month when the user enters and days.
Suppose that the user enters November 18, 2014 start date and date as November 23, 2014.
The output should display
Count: 4
November 18, 2014 Mar
Sea 19 November 2014
November 20, 2014 game
Fri November 21, 2014
It will exclude Saturday and Sunday.
Hello
Here is an example of removing dates Saturday and Sunday:
with days as( select (trunc(sysdate, 'YEAR') + level) as col from dual connect by level < 365 ) select * from days where trim(to_char(col, 'DAY', 'NLS_DATE_LANGUAGE=ENGLISH')) not in ('SATURDAY', 'SUNDAY') and col between to_date('18.11.2014', 'DD.MM.YYYY') and to_date('30.11.2014', 'DD.MM.YYYY') order by col;
Cheerz,
Stako
-
I have two dates with me, the task is to get the difference of these two dates, number of days and then convert that in years
for example if there are two dates 12/12/2000 and 12/12/2001
difference in days = 365 days
conversion from days to years: 1 year
We all built based on Oracle for the same thing? Or do manual calcualtion is a good idea?
In VB, we have the following for the same
Application.WorksheetFunction.YearFrac (Date1, Date2)
Kindly help me with this.
Thank you!You can use:
MONTHS_BETWEEN(date1, date2)/12
-
How to convert days to years, months and days remaining
Hi all
I have the number of days for example: 398 days how
convert 398 days to several years, and the number of months and days remaining
398 days 1 year, 1 month and 2 days
Concerning
JocelyneThere is no correct answer.
That's right! ;)
-
Number of days since 31/12/1979 converting a date value?
Hi all
I'm not an expert in oracle sql and I hope that someone could help me. A column of a table is titled BHS_KDTE_SEQU. This column has 111616 lines and the values stored in these areas are the number of days since 31/12/1979.
When I write a select statement, how can I convert to get the date value since 31/12/1979 instead of the number of days?
Thank you in advance!
Hello
f429ff94-4133-48E0-AE1C-afcb148d3c2f wrote:
Hi all
I'm not an expert in oracle sql and I hope that someone could help me. A column in a table is called BHS_KDTE_SEQU. This column has 111616 lines and the values stored in these areas are the number of days since 31/12/1979.
When I write a select statement, how can I convert to get the date value since 31/12/1979 instead of the number of days?
Thank you in advance!
Then
1 means January 1, 1980,
2 means January 2, 1980,
...
31 January 31, 1980, means
32 means February 1, 1980.
...
366 means December 1, 1980,
367 means January 1, 1981,
and so on?
Here's one way:
SELECT DATE ' 1979-12-31' + bhs_kdte_sequ AS dt
TABLE;
When you add a DATE d and a NUMBER n in Oracle, the result is the DATE n days after days.
I hope that answers your question.
If not, post a small example of data (CREATE TABLE and INSERT statements) and the exact results you want from these data.
Check out the Forum FAQ: Re: 2. How can I ask a question on the forums?
-
Data per day, per month, per year
Hello, there is a field in my table that includes dates.
I counted my recordings of data per day using the aggregator operator and
This simple select DATE, COUNT (*) FROM TABLE GROUP BY DATE
Can you tell me how I count my files per month or per year? Thank you.Hello
You can use functions to retrieve information from the date and use it, for example;
Select to_char (hiredate, 'YYYY') there, sum (sal) from emp group by to_char (hiredate, 'YYYY');
So in OWB if you have an expression before the aggregation operator, you can define the expressions and use them in the aggregation.
See you soon
David -
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 :)
-
Number of days for all the months of the previous 10 years
Hi guys,.
I wonder if there is a way to insert in my table of data for the period dimension all
days for the months of the year 2004,2005,2006,2007, etc..
Is there somewhere in the Oracle database that stored the number of days for all the months of the years?
I think I woud have to use a loop of the GET something like the following:
-The year month day
2004 - 1-1
2004 1-2
2004 1-3
2004 1-4
2004 1-5
2004 1-6
etc.
Assuming that there are 28 or 29 or 30 or 31 days the lines for January 2004 would be 28,29,30 or 31.
I need it for all the months and years.
Thank you
metalrayHello
The following SQL returns all the days from 01/01/1970 until today:
+ (Just modify the FRST to What You Need).with beginat as ( select trunc(to_date('1970/01/01','yyyy/mm/dd')) frst from dual ) select frst+(level-1) as daydt from beginat connect by level <= ceil(sysdate-frst);
With a previous alter session set nls_date_format = "dd/mm/yyyy hh24:mi:ss" result would be:
DAYDT ------------------- 01/01/1970 00:00:00 02/01/1970 00:00:00 03/01/1970 00:00:00 04/01/1970 00:00:00 05/01/1970 00:00:00 06/01/1970 00:00:00 (...) 09/01/2011 00:00:00 10/01/2011 00:00:00 11/01/2011 00:00:00 14986 rows selected.
In fact, the real question is: Why do you need them?
(^_^)Published by: Nicosa January 11, 2011 14:25
(for the correction) -
Subtract the number of days which falls a Saturday and Sunday
Hello
I want to calculate the productivity of employees using the fields of activity by obtaining the number of days and the number of hours. However, the number of days must not include sat and Sun. Refer to the table below:
TABLE:
Year - Date name - number of hours of
2010 - Joe - 2010-07-05 - 8
2010 - Joe - 06/07/2010 - 4
2010 - Joe - 06/07/2010 - 4
2010 - Joe - 2010-07-07 - 8
2010 - Joe - 2010-07-08 - 8
2010 - Joe - 09/07/2010 - 4
2010 - Joe - 09/07/2010 - 4
2010 - Joe - 2010-07-10 - 8
2010 - Joe - 11/07/2010 - 8
I converted the date field to #of days of Count (Distinct (Date)) using
Year - Name-# of days - number of hours of
2010 - Joe - 7-56
Now, I want to subtract the number of days which falls a Saturday and Sunday without affecting the hours #of. Is this possible?
Year - Name-# of days-# of Hours_
2010 - Joe - 5-56Try to use Count (Distinct (Date))-Count (Distinct BOX WHEN DAYOFWEEK (fx) IN (6,7) THEN NULL ELSE END fx)
where Fx is the expression of your date field -
I have data from a table that has the columns, MONTH, DAY, YEAR in NUMBER data type. I am wanting to convert that to DATE datatype and concate month, day, and year. Can someone help me please? Thank you
SELECT TO_DATE(month||day||year,'MM/DD/YYYY') FROM DATA_TABLE;
Dclipse03 wrote:
Gosh, now its gives me the error: not one month validthe man, trying to convert dates is totally not my thing...:)
Nor is anyone else. This is one reason people use DATE columns.
The valid months are integers from 1 to 12. You can find the lines which are not in this value by saying:
SELECT * FROM data_table WHERE month NOT IN (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12) OR month IS NULL ;
That will tell you what are the bad values. On this basis, you must decide what you want to do with the bad values.
-
Could you please tell me how to change the display of the date to display the day month year instead of month day year?
HOW to: Change the Date, time, number, and currency value displays in Windows XP
http://support.Microsoft.com/?kbid=307938
Check and tell if its working.
Maybe you are looking for
-
Scanner HP M277 function seems to arbitrarily arrest
Since the Mac OS upgrade, I have a strange problem. The function scanner built into the provided Apple, HP M277 printer driver seems to stop arbitrarily. When the button "scan" in the print queue window will be gray. If I go into the preferences syst
-
How can I activate the location in the browser so that I can look for things nearby?
I want to look for things of my position, but it keeps telling me that the browser will not allow it and I cannot find the place where to him allow.
-
Vista RTM - when there are drivers Toshiba?
the question is:Vista is RTM - when are we going to get drivers?I have a copy of it. legit copy btw...So what is the excuse for not providing driver? Thanks in advance for your answer.
-
HP Deskjet 980Cxi inkjet printer
PC - en vil I ikke driveren genom - det star feilmeldingen to driveren er installert men Virginia pa svar fra bruker-og jeg vet ikke kuhu eller jeg legger inne slikt svar t how? Terje
-
Right click &#62; open the startup folder opens search Active legends
I am running Vista Home Basic. When I click on the Start button, click programs, right-click the startup folder, and then clickOpen it does not open the startup folder. Instead, it opens a search window Active legends. How can I fix?