Group by on basis of year

Hi
My oracle version is 11.0.
I have to create group by query on basis of load_date ,load_date value is in format 'dd-mm-yy'
I have to group on basis of yy only ...not on complete date value.
Please help me on that ..thanks

siebelD wrote:
Hi
My oracle version is 11.0.
I have to create group by query on basis of load_date ,load_date value is in format 'dd-mm-yy'
I have to group on basis of yy only ...not on complete date value.
Please help me on that ..thanks
You really store only 2 digits in your dates?
You really want to group on just 2 digits of the years?
So, 1913 is the same as 2013, is the same as 2114 is the same as 0614 etc.  Are you sure?
Personally (and most businesses and developers would agreed), you should ensure you store 4 digit years and always work with 4 digits to ensure that the years are clearly distinguished form each other.  Many developers put a lot of hard work into fixing the Y2K bugs just before the year 2000, and the last thing we need is people reintroducing them by only using 2 digit years again.

Similar Messages

  • Sorting grouped values by month and year within chart

    Hello
    I have a really tough problem which I can't seam to figure out.
    I have a table called SOLAR_RETURN which has 4 columns:
    - ID
    - USER_ID
    - DATUM
    - RETURN
    On a page I have 3 links, one for showing the information from the database by day, month or year.
    The hidden field :P25_DATE_FILTER is being set through the URL when clicking one of the 3 links.
    I have a linechart with the following sql statement which pulls the correct data according to the value of :P25_DATE_FORMAT:
    select null link, to_char("SOLAR_RETURN"."DATUM", :P25_DATE_FILTER) as label, max("SOLAR_RETURN"."RETURN") as value from "SOLAR_RETURN"
    WHERE "SOLAR_RETURN"."USER_ID" = :USER_ID
    AND to_char(DATUM, :P25_DATE_FILTER) = decode(:P25_DATE_FILTER,'YYYY',to_char(DATUM, 'YYYY'),'MM-YYYY',to_char(DATUM, 'MM-YYYY'),'DD-MM-YYYY',to_char(DATUM, 'DD-MM-YYYY'))
    GROUP BY to_char(DATUM, :P25_DATE_FILTER)
    Everything is working great, only the sorting is messed up. I need to sort it so that when :P25_DATE_FORMAT is set to DD-MM-YYYY it will be sorted by year desc, month desc, day desc. If the value would be MM-YYYY it would need to sort by year desc, month desc.
    I have tried the following without succes:
    ORDER BY to_char(DATUM, :P25_DATE_FILTER) ASC
    --> This doesnt cut it since it sorts like this: (for example)
    01-2010
    02-2010
    11-2009
    12-2009
    Vice versa for DESC
    Is there any way that I can sort the grouped values by day, month and year seperately?
    Thanks in advance!
    Marc

    Hi,
    What is data type for column DATUM ?
    If it is date did you try ORDER BY DATUM DESC ?
    Br,Jari

  • Has anyone else had Library incorrectly group photos in the wrong year?

    Hi All
    I have just noticed, after installing iPhoto 06, that the app has sorted over 4,000 of my pics in to a '2006' folder. I like taking photos but not 4,000 in 34 days! Nearly all these photos were taken in 2005 (there are separate folders in my library for 2005, '04, '03 and earlier).
    I tried moving the pics in to the correct year folder but that did not work. Has anyone else experienced this problem?
    Cheers
    Simon
    iMac G5   Mac OS X (10.4.2)  

    I have a similar (maybe same) problem. I just got a new iMac and imported 9000 images from my external harddrive. Images had been accessed via my WIndox XP computer.
    iPhoto imported images but put several hundred pictures into the wrong "year" folder. 300 pics taken on a 2001 vacation were put into a year 2000 folder (didn't even have a camera in 2000). Some pics taken in 2001 were put into the 2002 folder.
    Can I manually take the pictures from the original/modified 2000 folder and move them into the 2001 folder, ... ?
    Anyone?

  • How can I sum record base on year in webi?

    Dear Expert,
    I would like to get some solution to solve my problem.
    How should I design report as image below?
    Best regards,
    Chenna

    Dear Ajay Gupta,
    Thanks for your solution.
    I have applied but it didn't solve.
    Please see the image below
    If you have any ideas please help me.
    Best regards,
    Chenna

  • Report not grouping by year

    Hi
    I have a report that is grouping by month but not year and I can't see why.
    I run the below query:
    select count(case when report_base = 2 then 1 end) as 'Base 1',
    count(case when report_base = 4 then 1 end) as 'Base 2',
    count(case when report_base = 5 then 1 end) as 'Base 3',
    month(Report_Date) as Month,
    year(Report_Date) as Year
    from [dbo].[SRF_Data]
    where Report_Date >= dateadd(month, datediff(month, 0, getDate()) -12, 0)
    group by year(Report_Date),month(Report_Date)
    And get the results below:
    When I put this into a report and run it the report shows broken down by month (it shows a 13 as well?) but not year. It is grouping the results for 2015 in with 2014. The X axis is set to Scalar as I want to show empty months. My category groups are set
    to Year and then month.
    Can someone let me know what I'm doing wrong?
    Thanks.

    Hi rjp1977,
    I tested the issue in my local machine, when we set Axis type to category, since there is no data for October, it will not be displayed. If we set Axis type to Scalar, October will be displayed in the chart, but the data of 2014 and 2015 will be displayed
    together by design.
    If you care about the function, i recommend you that submit the requirement at
    https://connect.microsoft.com/SQLServer/ . If the requirement mentioned by customers for many times, the product team may consider to add this feature in the next SQL Server version. Your feedback is valuable
    for us to improve our products and increase the level of service provided.
    In addition, the screenshot you provided has value of February 2015.
    If you have any more questions, please feel free to ask.
    Thanks,
    Wendy Fu
    Wendy Fu
    TechNet Community Support

  • Professional tax grouping change in mid of the year

    Dear All,
    In my company, i have to change professional tax grouping in mid of the year for few personnel area.
    For the month of april, may and june professional tax deducted as per the gujarat state and from july onwards it should be deduct as per the maharastra state. I have assigned the maharastra state professiona tax grouping to that personnel area in table V_7IN0P_PTX. Now my issue is that when i run  the july payroll, system calculate the professional tax carry forward of previous months.
    could any one provide the solution for the same.
    Thanks,
    Jyoti Patel

    Hi Jyoti,
    Look into the config. of following tables.
    V_T7INP1
    V_T7INP3
    V_T7INP4
    What you are getting the professional tax deductions in the july months simulation run.
    if any..let us know.
    V sai.

  • Pricing on the basis of specific group of materials by cumulating values

    Dear SAP Gurus,
    There is a requirement to cumulate the values of a certain group of material AND provide discount on the basis of that on the sales order.For example ,
    group 1 =mat A mat B if 1000 give 5%
    group 2 =mat c mat D if 2000 give 10%
    So at sales order
    mat A 1000
    mat B  500
    mat C  400
    In this situation ,group 1should be activated only and discount should be given and distrbuted on A and B.What will be the method and condition type for this situation.
    Regards,
    Sam Ahmed

    This is part of standard SAP pricing functionality.
    In V/06 check K029.
    Important fields to be activated are -
    In V/06, for your cond type
    Group condition
    Scale basis
    Create Material pricing gr. = G1
    and give it in MMR, MM02, Tab Sales: Sales Org 2, field "Material pricing group" in Materials A, B
    Then create the cond record in VK11 for your cond type (e.g. K029) with scales.
    If all settings are correct, then for sales order
    Mat A shall get discount
    Mat B shall get discount
    Mat C shall NOT get discount

  • Changing group from calendar year to GL year

    I am currently using Crystal reports with a ERP system called IQMS.
    I am trying to grab data from our genral ledger year (1 of august to 31 of july) instead of the calendar year.
    The data can come from either the year or the week (52 weeks). I am currently grouping items from the calendar year but cannot figure out a formula for taking say week 30 to week 29 of the next year and grouping it.
    Does anybody have suggestions on how to enter in this formula?

    Stephanie,
    Some DB developers really need to be punched in the throat.
    1st of all weeks are messy little animals all by themselves. they don't play nice with the other date increments. The start of a week rarely coincides with the start of a month or year...
    So lets just say that you are willing to live with the fact that weeks and months don't usually jive and that the use of weeks in the equation will throw of the exact determination of the GL year by a day or few in either direction... Here is what you want...
    IF {V_SHIPMENTS_WEEKLY.WEEK} >= 30
    THEN {V_SHIPMENTS_WEEKLY.YEAR} + 1
    ELSE {V_SHIPMENTS_WEEKLY.YEAR}
    The effect will be:
    weeks 1 - 29 of 2009 = 2009
    weeks 30 - 52 of 2009 = 2010
    weeks 1 - 29 of 2010 = 2010
    weeks 30 - 52 of 2010 = 2011
    HTH,
    Jason

  • News articles grouped by month and year

    PHP and MySQL...
    Don't know if I am going to get an answer here, but I am looking for a bit of advice on how to handle grouping of news articles into months and each then into the respective year to make it easier for the user to navigate content. I am trying to acheive this effect:
    2012
    - July
    - June
    - March
    - January
    2011
    - December
    - October
    - April
    2010
    - November
    - You get the idea I hope
    I have set up MySQL to use a 'date' field called fld_articledate (formatted as YYYY-MM-DD). I need to structure my recordset query to select by year and group it, but then I also need to group by month relative to that year, but I have no idea of where to begin. So I guess my question is two-part:
    How do I group by year?
    How do I then group by month of that year?
    Once I have my queries sorted, I assume I'd print to page with  repeat and nested repeat regions!
    Thanks.
    Mat

    PHP and MySQL both have a lot of built in functions for working with dates.
    Here is a little code example from one of my projects that is similar to what you want to do. this example uses PDO, but the query is the same if you are using the older mysql extension. the last line builds an array of the result. You may not need this.Also note that the month and year are returned from the query using aliases (month, year); They could just as well be called "mymonth' and myyear, etc. The second to the last like formats the result for display.
    $sql=$dbh->prepare("SELECT DISTINCT EXTRACT(YEAR FROM(startdate)) AS year, EXTRACT(MONTH FROM (startdate)) as month FROM courses WHERE startdate > $currentdate order by startdate");
    $sql->execute();
    while ($monthorder = $sql->fetch(PDO::FETCH_ASSOC)){
    $month = $monthorder['month'];
    $year = $monthorder['year'];
    $monthtext = date('F Y', mktime(0,0,0,$month,1,$year));
    $monthlist[]=array('month'=>$month, 'year'=>$year);
    Since you want to link to articles, you then need a second query that will retrieve those details based on whatever month is selected. something like this:
    ("SELECT courses.course_id, title, startdate, enddate, highlight_photo FROM courses WHERE startdate > '$currentdate' AND EXTRACT(YEAR FROM (startdate)) = '$year' AND EXTRACT(MONTH FROM (startdate)) = '$month' ORDER BY startdate")

  • Profit Center Groups Wise Report

    Hi Team,
    Is it possible to have GL Balance, Vendor and customer Balances on Profit Center Group Wise on basis of Plant to which few more plants are assigned.
    For Example:
    Company code is 1000
    Under Co. code 6 Plants are present ie; 2000, 3000, 4000, 5000,6000, 7000
    3000 and 4000 Plants reporting to 2000 plant 6000,7000 plants are reportting to 5000 plant
    for ex geographically you can imagine we have one comany code and uder that two main reporting centers are exists like south and north.
    For every plant we have 10  profit centers. To get the plant wise P&L and B/S we created  profit center groups and we are getting the reports in controlling but client require GL balances vendor balances Customer balances in FI on profit center group wise. (Both vendors balance FK01 & XK01, Customer balance FD01,XD01,  GL Account Balance of 2000,3000,4000 all combined)
    so i would like to know if we want FI reports like plant shall we create group profitcenter or we have some other option because p group wise  GL balnces customer balnces vendor balnces is must requyired for the client.
    Thanks,
    Madhu

    Hi
    You can check with below mentioned reports
    S_ALR_87013326 - Profit Center Group: Plan/Actual/Variance
    S_ALR_87013327 - Profit Center Comparison: Plan/Actual/Variance
    S_ALR_87013330 - Profit Center Group: Plan/Plan/Actual Versions
    S_ALR_87013332 - Profit Center Group: Current Period/Aggregated/Year
    S_ALR_87013334 - Profit Center Group: Compare Actual Quarters over 2 Years
    S_ALR_87013336 - Profit Center Group: Balance Sheet Accounts Plan/Actual/Variance
    S_ALR_87013337 - Profit Center Group: Key Figures
    S_ALR_87013339 - Profit Center Comparison: Return on Investment
    S_ALR_87009712 - Profit Center List: Plan/Actual
    S_ALR_87013340 - Profit Center Group: Plan/Actual/Variance
    S_ALR_87009726 - Profit Center Group: Plan/Actual/Variance by Origin
    S_ALR_87009734 - Profit Center Group: Plan/Plan/Variance
    S_ALR_87009717 - Profit Center Group: Quarterly Comparison of Actual Data
    S_ALR_87013342 - Profit Center: Statistical Key Figures
    Regards
    Praveen PC

  • Passport BBM group

    I will be having a BBM group to see what others are doing with it. It's not a support channel but we might be able to help others. Do no post your BlackBerry PIN here. Send me a PM via the forums or send me a DM on twitter.
    Can't wait to hear from other fellow Passport users.
    Click here to Backup the data on your BlackBerry Device! It's important, and FREE!
    Click "Accept as Solution" if your problem is solved. To give thanks, click thumbs up
    Click to search the Knowledge Base at BTSC and click to Read The Fabulous Manuals
    BESAdmin's, please make a signature with your BES environment info.
    SIM Free BlackBerry Unlocking FAQ
    Follow me on Twitter @knottyrope
    Want to thank me? Buy my KnottyRope App here
    BES 12 and BES 5.0.4 with Exchange 2010 and SQL 2012 Hyper V

    BBM is BlackBerry Messenger, their own messenger service that supports one to one, multi and groups.
    Its a fun way to stay in touch with people and I have made many groups in BBM over the years and keep in touch with 100s of peaople this way
    Click here to Backup the data on your BlackBerry Device! It's important, and FREE!
    Click "Accept as Solution" if your problem is solved. To give thanks, click thumbs up
    Click to search the Knowledge Base at BTSC and click to Read The Fabulous Manuals
    BESAdmin's, please make a signature with your BES environment info.
    SIM Free BlackBerry Unlocking FAQ
    Follow me on Twitter @knottyrope
    Want to thank me? Buy my KnottyRope App here
    BES 12 and BES 5.0.4 with Exchange 2010 and SQL 2012 Hyper V

  • Can I change Base DN without affecting Current Users Permissions

    I have deploed Live Cycle ES2 Rights Management about 2 years ago with a very limited user group for my base DN
    Current Base DN
    OU=mysite,OU=mycorp,DC=corp,DC=com
    I want to change it now to
    OU=mycorp,DC=corp,DC=com
    Since i am broadning the scope i just wnat to ensure it will have no effect on my current users permission for secure docs.
    Can anyone confirm this?
    Thanks,
    Version: 9.0.0.0, GM Patch Version: SP1 Service Pack Version: 9.0.0.1.20100511.1.236952
    Chad

    I would have to test the scenario but I think that these users would be considered new users and they'll get disconnected from the policies. I may be totally wrong but this is definitely something I'd do on a test machine.

  • Fiscal year variants in co.code  have inconsistent start date.Msg no AC531

    Hi Experts
    We went  with 24 periods after Go live.  I am trying to assign the TAX basis fiscal year variant(TX) at Depreciation area level. But it's not letting to add with the following error message.
    Fiscal year variants in co.code  have inconsistent start date
    Message no. AC531
    Diagnosis
    The first day of the fiscal year for variant TX (24periods) in company code in Asset Accounting differs from the first day of the fiscal year for variant  D1(12 periods) in General Ledger Accounting.
    However, both variants must have the same start and end date! Only the periods within the fiscal year can be different in the two variants.
    Please guide me how to fix this error message.
    Thanks in advance
    Meenakshi.N
    Edited by: Meenakshi.Nakshatrula on May 3, 2010 5:45 AM

    Hi,
    Message no. AC531  says:                                                                               
    The first day of the fiscal year for variant K4 in company code in Asset     
    Accounting differs from the first day of the fiscal year for variant NL      
    in General Ledger Accounting.                                                                               
    However, both variants must have the same start and end date! Only the       
    periods within the fiscal year can be different in the two variants.         
    The error is described in note 844029 :-                                                                               
    In the NewGL in Asset Accounting, it is still not possible for               
    depreciation areas to have fiscal year variants with different start and     
    finish dates. If you try to assign a fiscal year variant to an area,         
    whereby the fiscal year variant infringes this restriction, the system       
    issues error message AC 531.                                                 
    Regards Bernhard

  • How to get the value of a variable in group footer in the report footer also

    I have a placed a formula as below at the group footer and the report footer. The data is grouped on the basis of duedays which is again formula and the value in that is appearing correctly.
    Whilereadingrecords;
    Global Numbervar CNTONE;
    Numbervar P := P+1;
    IF P = 1 AND {@DUEDAYS} = 0
    THEN CNTONE := {spSUPPLIERSOA;1.INVOICEBAL}
    ELSE IF P>1 AND  {@DUEDAYS} = 0
    THEN CNTONE := CNTONE + {spSUPPLIERSOA;1.INVOICEBAL}
    At the group footer I get the value correctly for CNTONE but when I place the formula in Report footer I get the value for CNTONE as 0.
    Please do let me know how I could get the same value in the report footer also.
    Regards
    Sreejith J

    Hi Abhilash;
    When I give the statement whileprintingrecords then my above formula sums up only the first record and the last record of the group and when I give whilereadingrecords it adds up all the data in the group correctly.
    The formula that you mentioned for the report footer had worked out and it is showing my result correctly.
    I did not put up the reset formula on the group footer because as the group changes I had used another variable in another formula for example for the second group I used
    Whilereadingrecords;
    Global Numbervar CNTTWO;
    Numbervar Q := Q+1;
    IF Q = 1 AND {@DUEDAYS} = 30
    THEN CNTTWO := {spSUPPLIERSOA;1.INVOICEBAL}
    ELSE IF Q>1 AND  {@DUEDAYS} = 30
    THEN CNTTWO := CNTTWO + {spSUPPLIERSOA;1.INVOICEBAL}
    I have set up total 5 such formulas as the number of groups that will be formed is 5. I have put up these formulas on the group footer and suppressed it as I dont want to get it displayed.
    The as you suggested the solution for Report Footer I did that and getting the result correctly.
    I dont know I may be following a longer procedure
    Take Care
    Sreejith J

  • SSRS 2008 R2 - COUNTDISTINCT By Group

    Hello,
    Thanks for the help in advance.  I have some a results set that gives some numbers by country.  The countries selected are controlled by a parameter which is 'Multi Select'.  There could be one or many countries selected.
    My 'Detail' level dataset is fine, however I'd like to add a summarised DISTINCT count of numbers by country in another location on the report.  I'd like SSRS to do the summary (based on the detail rows it already has), rather executing another SQL query
    to the database for the summary.
    If there were a small list of countries I could do a COUNTDISTINCT IF Group = XYZ.  However as there could be a few or many, this is not practical.
    This is what the detail looks like:
    Here is an example of how I'd like to summary to look like (without doing a separate SQL query):
    Many Thanks,
    UnoT

    Hi UnoT,
    Per my understanding you want to count the number of the same country based on the Country field, right?
    I have tested on my local enviroment and we can use the count() function to do this,detial information below for your reference:
    I use the sameple data as below and count of the Year:
    Create an row group(Year1)based on the Year and select the entire column of the year to Insert an Inside Group-Right.
    Use below expression to count of the year:
    =Count(Fields!Year.Value,"Year1")
    Preview the result like below(If you don't want to display the Details(Amount), you can hide the entire column):
    If you have an unique field(Amount) you can also add this field in the details group(e.g Amount in above table) and using expression as below:
    =CountDistinct(Fields!Amount.Value, "Year1")
    If you still have any problem, please feel feel to ask.
    Regards,
    Vicky Liu
    Vicky Liu
    TechNet Community Support

Maybe you are looking for

  • Need help in displaying error message on the same screen

    Hi Experts, I have written a report which gets called from IW52 by clicking one of the action items. Now in my report when I am trying display an error message it is getting displayed at the bottom of a blank screen. My requirement is to display it a

  • Portadat to FCP 7 on MacBook Pro?

    I have a timecode portadat. What hardware and software do I need to transfer it to final cut pro 7 on my macbook pro?

  • POST Negative App Reviews HERE - Thread

    Since developers can delete negative reviews at will from App World, I propose we start a thread here.  Please post app name, developer, amount paid, and your feedback/issue.  PLEASE contact developer and RIM support before posting feedback.  Some de

  • MacBook Pro Thunderbolt with black screen

    Hi, my MacBook Pro 15" 2GHz, Core i7 with Thunderbolt, OS 10.6.7 has some problems: Sometimes I have to let run it during the night. When I wee it the next morning, it won't sleep, it is still on, but the screen stays black. Can't put it to sleep mod

  • Housekeeping and the Library folder...

    I've just been browsing the library folder (system rather than user library) and have noticed that some folders are colossal in size... so can I clear out some of the files that I KNOW that I now longer require? For example, in 10.4 there was no opti