Calculation based on the date, but the year & month on fileds separate.

Hello
Simple question:
I have a table with the SOURCE fields 9i, YEAR, MONTH
Because I don't have a date field, how I count for example records < 07/2008?

SAMPLE DATA:
.
.
.
APPLES; 2008; 06
APPLES; 2008; 07
APPLES; 2008; 08
.
.
.

Thanks in advance for your help.

Hello
do you want this?

with data
as
(select 'APPLES' SOURCE ,'2008' yy,'06' mm from dual union all
 select 'APPLES'  ,'2008' ,'07'  from dual union all
 select 'APPLES'  ,'2008' ,'08'  from dual)
select count(*)
from data
where to_date(yy||mm,'YYYYMM') <= to_date('072008','MMYYYY')

Tags: Database

Similar Questions

  • Extract data based on the year and month

    My clients have taken a field TimeStamp DB Oracle and downloaded the access in a TEXT field format.
    Samples: 20060401001348CS

    Everything I'm doing is extracted from the data based on the year and the month. I equal to 200604 *, 200604%. Have also tried to use AS.
    Nothing works. It may just be that dificult. Help, please. Thank you

    Mike

    I'm SO sorry. I have 35 years of Experinece in this area and I have my data (assuming) was all a 200604 date and he was not. The query did work. I'll have more questions and that you do not want to loose credability with this site. Again, I am sorry. Sincere to help thanks.
    Ron

  • Studio: Chart based on the day/month/year

    In the Studio, there is a requirement for us display the chart based on the day/month/year.

    Because the Date attribute does not appear as a Dimension in the graphics configuration list, I divided attribute date day/month/year attributes and inspiring that I generated a sample chart

    But now I am facing a problem

    Suppose that there are records for only July and Ms then the graph shows in July and Aug, it does not show in August.

    I agree that there is no record for August in my field of data which is the reason why Augustus is not displayed in the table. But according to our requirement, we must view August as well as with zero count.

    I'm curious to know if there is a way to do it.

    The idea behind the record calendar type is a secondary, new record type are you introduction that completes your registration type "sale."  The records you provided would be your 'sales' record type, not your type of registration of "calendar".  To use your example, your recordings of 'sale' would look like what provided you:

    =============== RECORD ==================

    ID: 1

    Sales_Amount: 1000

    Month: October

    RecordType: sale

    Date: 2012-10 - 01 T 00: 00:00.000Z

    day: 01

    year: 2012

    =============== RECORD ==================

    ID: 5

    Sales_Amount: 1000

    Month: December

    RecordType: sale

    Date: 2012-12 - 01 T 00: 00:00.000Z

    day: 01

    year: 2012

    ==========================================

    And your registration type "calendar" would be charged later.  I usually provide a single record of short for all day for this record type:

    =============== RECORD ==================

    ID: 1

    Month: October

    RecordType: calendar

    Date: 2012-10 - 01 T 00: 00:00.000Z

    day: 01

    year: 2012

    =============== RECORD ==================

    ID: 2

    Month: October

    RecordType: calendar

    Date: 2012-10 - T 02, 00: 00:00.000Z

    day: 02

    year: 2012

    ==========================================

    (and so on, one for each day until today... yawn)...

    =============== RECORD ==================

    ID: 790

    Month: July

    RecordType: calendar

    Date: 2013-07 - 31 T 00: 00:00.000Z

    day: 31

    year: 2013

    ==========================================

    Thus, when you write a statement of EQL as:

    RETURN foo AS SELECT

    Sum (Sales_Amount) AS "TotSales.

    GROUP BY month

    You will get a bucket of months for every month, where the record type "calendar" will not fail to offer a month when sales do not offer it... aka. Fill the "holes".

    HTH,

    Dan

    http://branchbird.com

  • A drop-down list can do the calculation based on the value selected in a drop down list?

    Form Acrobat X Pro Adobe

    Can I have a drop down list create a calculation based on the value selected in the menu drop-down?

    We have a set lunch and want the user to choose to be "A lunch', 'Lunch B'"C Lunch"or"just the milk. "

    It is for each of the 5 days of the week. There are therefore 5 drop downs, which have all the same 4 above choice.

    If the user chooses among the 3 lunches and then put $2.00 in the total box at the end of the line. If 'Just the milk' may put 0.50 in the box.

    The total area at the end of the line must keep a record of all 5 days and give a total.

    So if someone chooses lunch A LUN, sea and Sun and just milk for Tuesday and Thursday and then the total for this week must be $7,00

    Is it possible by using code or something?

    I did it in Excel, but we need it is an Adobe pdf file.

    TIA

    OK the total box has a 10 all the time to make it look like $ 2.00 for

    everything.

    Before even that I chose something there are 10 in the box.

    I am a newbie to Adobe scripting Total used VB/A .NET etc ' 1980

    However.

    Can you do any debugging in code?

    Initialize the sum

    var sum = 0;

    Make a loop on the drop-down list boxes and add the cost of the invoice sum

    for (var i = 1; i)< 6;="" i="" +="1)">

    Sum += getField("Week1Day"_+_i).value == 'just milk? 0.50: 2,00;

    }

    Set this field to the amount

    Event.Value = sum;

  • The date system in the taskbar indicates the year, month, day (as in the army). How can I read the day, month, year?

    The date system in the taskbar indicates the year, month, day (as in the army). How can I read the day, month, year?

    It's weird, in my version (Windows 7 Pro), it shows much more than that.

  • 5 digit unique random number based on the year

    Hello
    I need 5 digit unique random number based on the year. If the new year then duplicate random number allowed.
    Thank you

    If only 5-digit numbers are needed you can extract some transformation injective (http://en.wikipedia.org/wiki/Injective_function) and you could easily check for uniqueness:
    substr (to_char (ln (sequence_value)), 10, 5)
    substr (to_char (exp(1 / sequence_value)), 20, 5)
    ...

    Concerning

    Etbin

  • Quarter filter based on the selected month

    Hi all

    I need to filter the report with quarter based on a period in the report guests.

    The user selects the name of month in prompt report, the report should show the information of quarter data falling from the chosen month. I used the subreport that provide a quarter of the month. This degrades performance report, so I need a solution to find a quarter of the month in the filter of the report itself. Can anyone provide an idea on that?

    Well, now that I know the syntax, it should work for you:

    Assumptions: "month" is in the format "LUN - AA' (DEC-11); quarter is in the format "YYYY Q M" (2012 Q 2);

    Here are the pieces of the CASE statement...

    LEFT (' @{pv_month}', 3)... allows at least 3 letters ("Jan", "Feb", etc.) of the selected month...

    .. Right('@{pv_month}',2) .save the month selected two-digit year...

    Cast (Right('@{pv_month}',2) AS INTEGER)... .converts as a whole two-digit year. It is how we use the year in a calculation to determine the correct exercise when the month is September, October, November or December. In this case, (11) two-digit year is less than the tax (2012) year.

    Here are the facts:

    Q-11 MAY 2011 3 MAR-11
    JUN-11 AUGUST - 11 2011 Q 4
    SEVEN.-11 TO 11 - NOV 2012 Q 1
    DEC-11 TO 12 FEBRUARY 2012 Q 2
    etc...

    The above represents an exercise. As you can see, for the months from March to August, the exercise is the same as the selected year (all that is needed is to convert the year to two digits of a four-digit year).
    When the month is seven, Oct or Nov, the year must be incremented by 1. Month Jan and Feb, exercise is identical to the year chosen, but Dec must be dealt with separately, because even if exercise is the same as Jan and Feb (2) year should be incremented.

    Gather all this logic, you get the following:

    BOX WHEN IN LEFT('@{pv_month}', 3) ('SEP', 'OCT', 'NOV') THEN '20'. Cast (Cast (Right('@{pv_month}',2) AS INTEGER) + 1 AS CHAR). "Q 1'
    OTHER CASES WHEN leash (' @{pv_month}', 3) = 'DEC' THEN '20'. Cast (Cast (Right('@{pv_month}',2) AS INTEGER) + 1 AS CHAR). "Q 2'
    On the OTHER BOX WHEN IN LEFT('@{pv_month}', 3) ("JAN", "FEB") THEN '20'. Right('@{pv_month}',2) | "Q 2'
    OTHER CASE WHEN LEFT('@{pv_month}', 3) IN ('MAR', 'April', 'MAY') THEN '20'. Right('@{pv_month}',2) | "Q 3'
    ANOTHER BOX WHEN IN LEFT('@{pv_month}', 3) ("JUN", "JUL", "Aug") THEN '20'. Right('@{pv_month}',2) | "Q 4'
    END END END END END

    This will give you a quarter based on the selected month. You can use in the filter (Advanced > convert this SQL filter) and apply it on your column 'quarter '.

    WARNING: I did at home in order to check the syntax...

  • difference between two dates in the year/month/day in Obiee

    Hi gurus,

    I know this question have been asked and answered several times but I have a requirement that is a little different, then the previous ones.

    I want to calculate the difference between two dates in OBIEE10g in year/month/day format similar to the below SQL output

    SQL > select end_date, start_date,

    trunc (months_between (end_date, start_date) / 12) years.

    months of mod (trunc (months_between (end_date, start_date)), 12).

    End_date - add_months (start_date, trunc (months_between (end_date, start_date))) days

    t

    Thanks in advance

    SK

    Search for this

    "TIMESTAMPDIFF IN THE FORM OF MTHS # YEARS."

    or else

    To get the current mandate of employees since the date of hiring in the form of # years # mths or # year (s) # month (s)

    Concat (concat (cast (TIMESTAMPDIFF (SQL_TSI_Month, "Employee attributes". (((' ' Hiring last Date employee ", CURRENT_DATE) / 12 as char),"Year (s)"), concat (cast (MOD (TIMESTAMPDIFF (SQL_TSI_Month,"Employee attributes". (((((' ' Hiring last Date employee ", CURRENT_DATE), 12) as char), 'Month (s)'))

    Concat (concat (CAST (TIMESTAMPDIFF (SQL_TSI_YEAR, "Employee attributes". (((' ' Hiring last Date employee ", CURRENT_DATE) as CHAR),"Year (s)"), concat (cast (MOD (TIMESTAMPDIFF (SQL_TSI_Month,"Employee attributes". (((((' ' Hiring last Date employee ", CURRENT_DATE), 12) as char), 'Mth (s)'))

  • Suggest the Sql query to get the years, months, days of the two dates.

    Hi all

    SELECT TO_DATE('06-02-2014','DD-MM-YYYY') - TO_DATE('01-04-1998','DD-MM-YYYY') SERVICE_DAYS OF THE DOUBLE

    5790 SERVICE_DAYS

    POWER REQUIRED:
    YEARS MONTHS DAYS
    15 10 5

    OUTPUT DISPLAY:

    Select
    Floor(5790/ 365.25),
    Floor (mod (5790,365.25) / (365.25 / 12)),.
    ceil (mod(5790,365.25 / 12))
    Double;

    YEARS MONTHS DAYS
    15 10 7 - TWO DAYS MORE


    How they calculate manually is as follows:

    2014 02-06
    1998-04-01
    ---------------
    05 - days

    2014 02-06
    1998-04-01
    + 12
    ---------------
    10 month 02 is lower than 04, so we borrow 12 months of TI (2014) years will be (2013)

    2014 02-06
    1998-04-01
    -(1).
    ---------------
    15. for the years since we-1

    Kind regards

    Afzal.

    OK... so try not not to multiply the reminder to add_months with 30 but to solve the 'day-thing' in a different way...

    first step (data) is only my implementation testdata.

    WITH DATA AS (SELECT TO_DATE('02-03-2014','DD-MM-YYYY') AS Degnide

    TO_DATE('07-04-2008','DD-MM-YYYY') AS dayfrom

    OF the double

    UNION ALL

    SELECT TO_DATE('12-04-2014','DD-MM-YYYY') AS Degnide

    TO_DATE('11-05-1994','DD-MM-YYYY') AS dayfrom

    OF the double

    UNION ALL

    SELECT TO_DATE('06-02-2014','DD-MM-YYYY') AS Degnide

    TO_DATE('01-04-1998','DD-MM-YYYY') AS dayfrom

    OF the double

    )

    calc AS (SELECT months_between (dayto, dayfrom) SERVICE_DAYS

    Degnide

    dayfrom

    DATA)

    SELECT Degnide

    dayfrom

    floor(service_days/12) IN years

    floor (mod(service_days,12)) AS month

    , BUSINESS sign (EXTRACT (Degnide DAY) - EXTRACT (DAY FROM dayfrom))

    WHEN THEN-1 EXTRACT (DAY FROM Degnide) + 30 - EXTRACT (DAY OF THE dayfrom)

    WHEN 0 then 0

    WHEN 1 THEN EXTRACT (Degnide DAY) - EXTRACT (DAY FROM dayfrom)

    0 OTHERWISE

    end as days

    CALC

    HTH

  • How to copy the data for the current month for future months based on the current month

    Hello

    If the current month is Jan they copy data Jan rest months this year there. If the current month's data copy Feb Mar Feb, Apr, dec... and so on... The following script can achieve this goal, but it increases the number of lines of code... Please y at - it another way that we could achieve this functionality.

    Difficulty (year1, entity1)

    "account1" (if (& Currentmonth == "Jan"))

    "account1"-> "Feb" = "account1"->"Jan";

    "account1"-> "Mar" = "account1"->"Jan";

    ------

    ---

    "account1"-> "Dec" = "account1"->"Jan";

    ElseIf (& ifcurrentmonth == 'Feb')

    "account1"-> "Mar" = "account1"->"Feb";

    --

    "account1"-> "Dec" = "account1"->"Feb";

    endif ;);

    endfix;

    Thank you

    Praveen

    Hi Praveen,

    You can write a script as shown below

    Fix(Year,Entity,&Currentmonth:DEC)

    Account1 = account1-> & Currentmonth;

    endfix

    This will make.

    Concerning

    Anubhav

  • Calculation based on the box help please...

    I'm doing a text box run a calculation based on whether or not a radio button is checked or not.

    If the radio button named 'Built' in the group 'Type of Quilting' is checked, then the text box "By squirting the load" must find the value of the field "Total Square Inches" and multiply this total by 0.015 and show the new total in the text box as a monetary value, if the 'Casting' radio button is not checked the value in the field 'Charge of basting"should be"- 0 -".

    I can get the calculation that I want this:

    var v1 = getField("Total_Square_Inches").value; Event.Value = v1 * 0.015;

    But how to understand the function of the radio button and "- 0 -"?

    If the name of the field is built, the calculation script could be:

    (function () {}

    Get field values

    var v1 = getField("Total_Square_Inches").value;

    var v2 = getField("Basting").value;

    Set this field value

    If the check box is selected in function

    If (v2 = 'Off') {}

    Event.Value = 0;

    } else {}

    Event.Value = v1 * 0.015;

    }

    })();

  • Unable to make a comparison based on the year

    [https://spreadsheets0.google.com/ccc?key=teqXtSjikwYJSmpwlOdNtHQ & hl = en & authkey = CKn1_eIF #gid = 0]

    Hello
    I am building following report in a table format

    Colums
    Year month status reserved rooms.
    Jan 10 2010 5 DEF
    2010 10 jan OPT 3
    10 Feb 10 2010 9
    2009 jan 09 20 DEF
    2009 jan 09 15 OPT
    2009 Feb 09 10 30

    the report is expected to show show in the link below

    https://spreadsheets0.Google.com/CCC?key=teqXtSjikwYJSmpwlOdNtHQ & hl = in & authkey = CKn1_eIF #gid = 0


    No idea how can I achieve this?



    Thanks and greetings
    Giuliano

    The part of the year of your month, band

    concerning

    John
    http://www.obiee101.blogspot.com/

  • Return a value based on the current month

    I'm sure it's super simple but I can't quite understand the syntax for conditional dates, especially in months.

    Column A list of the last 12 months. Column B lists 12 amounts.  So, if it is currently Jan, return B1; If it's February return B2, etc.

    Thank you for your attention.

    Hi,

    Maybe that's what you're after.

    Formula in the table A2 today

    = TODAY()

    Formula in B2 to the table today

    = MONTHNAME (MONTH (A2))

    Formula in the table C2 today

    = VLOOKUP(B2,Data::A:B,2)

    Months in the data table are in text format as format number Date & schedule will include the full date and time. If the year is different today, he cannot find a match. Just in case.

    Kind regards

    Ian.

  • In formcalc calculation based on the date

    Hello

    I'm a newbie to Adobe Livecycle but of learning.  I create a voucher for fees for employees to be reimbursed for mileage however I would like to create an if statement if the date of the expense is equal or prior to June 30, 2012, then multiply the number of miles driven by a rate of $0,555 per mile and if the rate of charges is equal to or after 1 July 2012 and then multiply the number of miles by a rate of $0.600 per mile.  I have created specific fields labeled dteexpenseDate (field of the date of the entry by the user), decnumberMiles (number of miles engine) and decmileageRate (mileage rate).

    Currently I have this code;

    currentDate var = Date2Num (dteexpenseDate.rawValue = "" 2012-06-30)

    var Datedepense = Date2Num (dteexpenseDate.rawValue, "YYYY-MM-DD")

    var TestNotedefrais = Datedepense - currentDate

    if(expenseTest<0) then

    Sum(decnumberMiles*0.555)

    on the other

    Sum(decnumberMiles*0.600)

    endif

    I'm using formcalc currently but would be open to the use of javascript. I am aware that this is not correct, as I make mistakes, but I've not found anything on the internet to help me.  Any help would be greatly appreciated.

    Thank you

    Lindsay

    I guess you want to fill the last of the 3 fields (mileage rate)? If so, use the calculate event in formCalc with something like

    var changeDate = Date2Num( "2012-07-01", "YYYY-MM-DD" )
    var expenseDate = Date2Num( dteexpenseDate.rawValue, "YYYY-MM-DD" )
    var expenseTest = expenseDate - changeDate
    
    if ( expenseTest < 0 ) then
        $ = decnumberMiles * 0.555
    else
        $ = decnumberMiles * 0.600
    endif
    

    FormCalc has its benefits (faster, better date handling, etc.) but it is not as flexible as javascript as well as the fact that there are not as many places on the web that can give you some examples.

  • vSphere and vCenter license price is based on the YEAR?

    Hello

    Even if I already know as the product of vSphere and so forth and I am familiar with other virtualization technologies (I will avoid to mention here), I would like to ask about the license costs.

    Currently, we use various stand-alone vSphere servers (sometimes evaluation license and a free license for 5.5), but I would like to have vMotion Metro and subnet rather than in private solutions like 'Veeam' quick migration, etc.

    I went to see the costs... which are generally extremely high, but then I realize that the cost is basic 1 year or 3 years, which means that all VMWare license costs are billed ANNUALLY?

    I mean, if I have 3 hosts ESXi and a cVenter with cost € 4000 will be € 4000 per year? I think it's crazy.

    Can anyone confirm?

    Concerning

    Hey,.

    When you buy the license first, you pay X amount, which includes the license to base 1 or 3 years Support and subscription (SnS).

    After this time, you pouvez renew your SnS for amount Y. For vSphere, one year basic Support is about 10% of the initial report and if I remember correctly.

    But you don't have to renew the SnS, your software will continue to work.

    SnS assets allows you to call VMware and leader in applications for support and very important: you can upgrade your license to the new major version keys when it comes out.

    If for example you can improve your keys of vSphere vSphere 5 6 keys subsequently.

    Tim

Maybe you are looking for

  • Satellite P105-S6114 - gray line vertically on the screen

    Hello I'm new to the forum so please excuse me if I look like a novice (because I am).I have a Toshiba P105-S6114 that suddenly developed a gray vertical line about 1 inch wide and about 3 inches from the right side of the screen. It seems that if it

  • Impossible to reinstall windows Vista on HP DV6500

    Hello! Recently I was faced with a "blue screen" error As he kept back, I tried to reinstall my operating system, Vista. However, it is impossible to install. Now, it seems impossible to install Vista or get into the recovery system. Can someone help

  • deletion of the optional updates in the update list

    in xp, there is a way to have the system of does not offer an update again.  is there a way to do this in windows update on vista?

  • activation of Vista to win 7 pro

    I got a laptop for my daughter and she didn't want XP. She loved the vista because it's what they were at the school. So, I took the vista ultimate that I already had and installed on the laptop. now three months later he told me that it is bad and t

  • Convert an internal drive in external drive = how fornat Lenovo's Style

    Hello I want to format my internal drive which is now an external HD = how are we doing? Knowing that it was an internal HD = with The Hard drive / The Recovery HD / and Drv system :/ Thanks for the help