Inserting the default value for non existing date

hello,
i am designing a matrix report for payslip for month wise in oracle 6i report builder.
in that i want to display per day working hours of the month.
i m using following query for achieving my goal :
select a.paycode,b.empname,c.departmentname,to_char(a.dateoffice,'DD') dateoffice,a.shiftattended,round(decode(a.hw,0,a.mannual_hours,a.hw),0) hw,
a.ISMANNUAL,A.STATUS
from tbltimeregister1 a,
     tblemployee  b,
      tbldepartment c
where a.paycode=b.paycode and
(a.hw >0 or a.mannual_hours is not null ) and
a.departmentcode='D05' AND
a.departmentcode=c.departmentcode and
a.dateoffice between to_date('01/12/2012','dd/mm/yyyy') and to_date('31/12/2012','dd/mm/yyyy')
ORDER BY A.PAYCODE,A.DATEOFFICEit is displaying the hours for the date in b/w date ranges exist in master table.
my problem is that if any date of a month is not in master data ,it should display the given date in DD format with 0 hours , A(absent) status, and null shift by default.
pl tell me how to modify my query for getting my desirable result.
Thanking You
Regards
Vishal Agrawal

965354 wrote:
hello,
select a.paycode,b.empname,c.departmentname,to_char(a.dateoffice,'DD') dateoffice,a.shiftattended,round(decode(a.hw,0,a.mannual_hours,a.hw),0) hw,
a.ISMANNUAL,A.STATUS
from tbltimeregister1 a,
tblemployee  b,
      tbldepartment c
where a.paycode=b.paycode and
(a.hw >0 or a.mannual_hours is not null ) and
a.departmentcode='D05' AND
a.departmentcode=c.departmentcode and
a.dateoffice between to_date('01/12/2012','dd/mm/yyyy') and to_date('31/12/2012','dd/mm/yyyy')
ORDER BY A.PAYCODE,A.DATEOFFICEit is displaying the hours for the date in b/w date ranges exist in master table.
my problem is that if any date of a month is not in master data ,it should display the given date in DD format with 0 hours , A(absent) status, and null shift by default.
pl tell me how to modify my query for getting my desirable result.Your problem isn't exactly clear to me. How do you pass the dates to be compared to the DateOffice column? It will be better to ensure the Master table contain data for each date (with some default values) and you will not have to tweak your sql.
Below is a possible solution:
select *
  from
select a.paycode,b.empname,c.departmentname,to_char(a.dateoffice,'DD') dateoffice,a.shiftattended,round(decode(a.hw,0,a.mannual_hours,a.hw),0) hw,
a.ISMANNUAL,A.STATUS
from tbltimeregister1 a,
     tblemployee  b,
      tbldepartment c
where a.paycode=b.paycode and
(a.hw >0 or a.mannual_hours is not null ) and
a.departmentcode='D05' AND
a.departmentcode=c.departmentcode and
a.dateoffice between to_date('01/12/2012','dd/mm/yyyy') and to_date('31/12/2012','dd/mm/yyyy')
union
select a.paycode,b.empname,c.departmentname,to_char(&date_variable,'DD') dateoffice,null,round(decode(a.hw,0,a.mannual_hours,a.hw),0) hw,
a.ISMANNUAL,'A'
from tbltimeregister1 a,
     tblemployee  b,
      tbldepartment c
where a.paycode=b.paycode and
(a.hw >0 or a.mannual_hours is not null ) and
a.departmentcode='D05' AND
a.departmentcode=c.departmentcode and
ORDER BY A.PAYCODE,A.DATEOFFICEIf this is not what you are looking for, then
1. Post a script that helps us to create the Tables required in your query
2. Some sample data. That includes the data for master table that has missing dates (4-5 rows should suffice)
3. The expected results from the sample data you posted.
Please do not forget to mention your version:
select * from v$version;

Similar Messages

  • How to set the Default values for Info Objects in Data Selection of InfoPac

    Hi All,
    Flat file Extracion:
    How to set the Default values for Info Objects in Data Selection Tab  for Info Package
    ex: Fiscal Year Variant  Info Object having values 'K4' 'Y2' etc  in Flat file
    Initially  default value(not constant)  for this info Object value should be 'K4'  in Info Package
    If I set data selection value for this info object K4 it will retreive records with this selection only? how to handle
    Rgds,
    CV

    Hi,
    suppose as your ex. if you are having fiscalyear variant in the dataselection tab then specify K4 in the from column, again the ficalyearvariant row and click on insert duplicate row at the bottom . you will get another row . In that enter Y2 in the from column. now you can extract K4, y2 values .
    haritha

  • The default value as "None" for the report filter which is Value List type?

    Hello,
    I want to know is it possible to make the default value as "None" for the report filter which is Value List data type?
    For example:The Project Classification Value List value type which have many value like "Supplier Rationalization" "Category Sourcing" "Contract Regegotiation" etc, and the value "Supplier Rationalization" is in the frist positon in the value list. When i use "Project Classification " as a report filter, the value "Supplier Rationalization" displayed as default value. And in the value list box in report filter of Project Classification , there is a value "None" which should be added automatically by system. So i manually filled the default value with "None" in Filter Prompt screen, but it does not work. After i display the report ,the Project Classification filter still use the ""Supplier Rationalization" as the default value.
    My current ESO version is 5.1. I tried other ESO version like 5.15, if i manaully give a default value "None" in Filter Prompt screen for filter Project Classification, then the default value is "None". It works well.
    Does anybody know if it's possible to do the same thing in ESO 5.1?
    Thanks & Regards,
    David
    Edited by: David Gao on Aug 11, 2010 4:06 AM

    Hi David -
    This is possible, but the technique is not too obvious...
    To make "None" be the default choice for a query definition filter parameter of type value list type, you need to set the default value of the filter parameter to the following:
    <internal id of value list type>:616:NULL
    For example, I believe you will see that the internal id of the Project Classification value list type is 51, so the default value of the filter parameter would be:
    51:616:NULL
    I hope this helps.
    Regards,
    Rob

  • How to set the default values for print options

    Hi all,
    We can set the default value for print options, just like Logical destination、numbers of messages、print immediately and so on, so where we should to maintain these default?

    Hi Sandy,
    This can be done by an abaper by making changes in the driver program. The Driver program feeds all the data which u have mentioned for printing.
    if the driver program is standard. copy to an z type and make modification on printer settings on the driver program code.
    this will surely solve the issue.
    Regards
    Gunaseelan

  • How to make a subscription use the default value for a parameter

    Hi everyone,
    I need to use the CreateSubscription method and have this new subscription use a default value for certain parameter. How can I do this?

    Hi Marianne,
    I have to create the subscription programatically, which is different from what you mention. To further clarify my challenge:
    I have three parameters in a report: date-interval (string), start-date (date), end-date (date). If the user selects for example "last week" as the date-interval, the DEFAULT values for the other two are as follows:
    Code Snippet
    start-date=DateSerial(Year(Today),Month(Today),Day(Today)-Weekday(Today)-6)
    end-date=DateSerial(Year(Today),Month(Today),Day(Today)-Weekday(Today)-1)
    The user can then select intervals like "today", "yestarday", "this month" etc, and the other two parameters are calculated based on that date-interval parameter. Now, If I programatically create a subscription to a report that contains these three parameters and set a value of "last week" for the date-interval parameter, the subscription stores the fixed days (say september 10 to september 16) producing a report of the same week every time the subscription is run and not updating the correct interval to LAST-WEEK!. What should I put as the value for start-date and end-date when I create the subscription to have these two params get the DEFAULT calculated value based on the third param date-interval?
    Hope to have been more clear now.

  • SRM 4.0- How to set the default values for product type (01) only for SC

    The radio button “Service” should not be visible.
    Also for search help (e.g. search for internal products) where a search should only be possible for product type 01 (goods). The system should not display the product type and internally always search for goods only.
    How to set the default values for product type (01) only for SC
    We needs to use Search help BBPH_PRODUCT which having parameter PRODUCT_TYPE
    Here we can set defalut value 01 but it is not correct one since same search help is using several places.
    We need to limit the search help results only for SC.
    Kindly help out me ASAP.

    The easiest way to set defautl values is to edit the batch class.
    Goto the characteiristic and go to update values.
    In here you probably have something like 0 - 100 as a spec range.
    On the next line enter the default value within this range.  At the end of the line, click in the box in the column labelled "D".  This indicates the defautl value for the characteristic.
    If you need to you can do this in the material classification view as well.
    Just to be clear, these values will only show up in the batch record.  You can not have defautl values in resutls recording screens.
    FF

  • How can I get the default value of a particular preference programatically. I know I can see the default value for some of the preferences in about:config but, I need a programatic way to get the default value.

    <blockquote>Locked by Moderator as a duplicate/re-post.
    Please continue the discussion in this thread: [tiki-view_forum_thread.php?comments_parentId=702631&forumId=1]
    Thanks - c</blockquote>
    == Issue
    ==
    I have a problem with my bookmarks, cookies, history or settings
    == Description
    ==
    How can I get the default value of a particular preference in FireFox?.
    I know I can see the default value for some of the preferences in about:config but, I need a programatic way to get the default value.
    I see some that there are values for preferences in firefox.cs but I am not certain that these are being used as the default values for preferences. prefs.js in user's profile only has the updated values and not the default values.
    Any help towards acheiving this programtically is greatly appreciated.
    If the default values are stored in a file, kindly let me know the format in which it is stored for me to parse it programatically.
    == User Agent
    ==
    Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Win64; x64; Trident/4.0; .NET CLR 2.0.50727; SLCC2; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0)

    Dear Friend,
    Here when you have the callableSattement as ?=proc(?), the first ? is an output parameter. So you should register it as out parameter using registeroutparameter.
    Then you can get the value from the outparameter using callablestatement.getXXX().
    Try that way.
    For free tral versions of JDBC Drivers go to www.Atinav.com

  • What are the default values for "default if unwired"?

    How do you know what the default value for an object will be...if using a "use default if unwired" with an event case?
    Is there a listing somewhere of what default values will be?
    Thank you,
    cayenne

    tst wrote:
    Personally, I would highly recommend disabling this on every single tunnel coming out of an event structure (with the possible exception of the tunnel going to the loop's stop terminal). If you use this option, you are almost guaranteed to forget to wire a required value into a tunnel at some point in the future when you add a new case.
    More generally, I think that this option should not be the default for these tunnels. You can see more about this here and I would suggest voting it up if you agree with it - http://forums.ni.com/t5/LabVIEW-Idea-Exchange/Outp​ut-tunnels-from-event-structure-should-default-to-​...
    VERY much agreed!  Disabling the "default if unwired" option makes absolutely certain that you have considered the correct value for every case.
    Bill
    (Mid-Level minion.)
    My support system ensures that I don't look totally incompetent.
    Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.

  • Best way to put the default values for the Form Items

    Hi,
    I am having a form with lot of default values as mentioned below..
      Field                      value 
      created by             :APPL_USER
      creation_date         SYSDATE
      last_updated_by     :APPL_USER
      last_update_date    SYSDATE
      item1                     value1
      item2                     value2Currently I am using Computation -> After Submit.....so whenever we create/update a record...these computaion takes place and the default values get inserted....THIS IS WORKING PERFECTLY FINE.
    I want to know..if this approach is fine OR we may have some better approach to acheive this...????
    Thanks,
    Deepak

    Deepak,
    Sample trigger code:
    CREATE OR REPLACE TRIGGER  "BINS1_APPLICATION_TBL"
       BEFORE INSERT
       ON APPLICATION_TBL    FOR EACH ROW
    BEGIN
       --  Description: Insert creation_dt, creation_id,
       --              lst_updt_dt and lst_updt_id
       --  Maintenance:
       --  Date        Actor           Action
       --  ====        =====           ======
       --  20-Aug-2009 J. Wells         Create.
       :NEW.creation_id := V('APP_USER');
       :NEW.creation_dt := SYSDATE;
       :NEW.lst_updt_dt := :NEW.creation_dt;
       :NEW.lst_updt_id := :NEW.creation_id;
       SELECT APPLICATION_seq.NEXTVAL
         INTO :NEW.APPLICATION_seq
         FROM DUAL;
    END bins1_APPLICATION_tbl;
    ALTER TRIGGER  "BINS1_APPLICATION_TBL" ENABLE
    /Jeff

  • How to read the default value for a Registry Key

    I am trying to use webutil 1.0.2 Client_win_api_environment.read_registry to read the client registry key HKEY_CLASSES_ROOT\.xls, but the function is raising no_data_found. I can read the registry key in Regedit. I am logged on as myself as a non-admin NT user.
    P.S: The Client_win_api_environment.read_registry can actually read HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\FORMS90_PATH because FORMS90_PATH is a registry ENTRY, whereas .xls in HKEY_CLASSES_ROOT\.xls is a KEY, but I still need the DEFAULT value of the key and it does NOT seem to work with client_win_api_environment.read_registry
    My platform: Windows NT 4, Developer 9i 9.0.2.12.2, Oracle database 9.2.0.4.0, Oracle 9iDS
    Webutil.log
    ===========
    192.168.0.99:Lewis: 2003-Dec-17 16:36:44.998 WUL[getProperty()] Getting property WUL_ADD_PARAMETER
    192.168.0.99:Lewis: 2003-Dec-17 16:36:45.08 WUL[getProperty()] Value of WUL_ADD_PARAMETER=3
    192.168.0.99:Lewis: 2003-Dec-17 16:36:45.08 WUL[setProperty()] Setting property WUL_PARAM_PROPERTIES to B|14|33|50|0|2000
    192.168.0.99:Lewis: 2003-Dec-17 16:36:45.28 WUL[getProperty()] Getting property WUL_ADD_PARAMETER
    192.168.0.99:Lewis: 2003-Dec-17 16:36:45.28 WUL[getProperty()] Value of WUL_ADD_PARAMETER=4
    192.168.0.99:Lewis: 2003-Dec-17 16:36:45.38 WUL[setProperty()] Setting property WUL_PARAM_PROPERTIES to B|14|33|50|0|0
    192.168.0.99:Lewis: 2003-Dec-17 16:36:45.48 WUL[getProperty()] Getting property WUL_ADD_PARAMETER
    192.168.0.99:Lewis: 2003-Dec-17 16:36:45.48 WUL[getProperty()] Value of WUL_ADD_PARAMETER=5
    192.168.0.99:Lewis: 2003-Dec-17 16:36:45.58 WUL[setProperty()] Setting property WUL_INVOKE_SPEC to 1|14|33
    192.168.0.99:Lewis: 2003-Dec-17 16:36:45.68 WUL[getProperty()] Getting property WUL_INVOKE
    192.168.0.99:Lewis: 2003-Dec-17 16:36:45.68 WUL[getProperty()] Value of WUL_INVOKE=-1
    192.168.0.99:Lewis: 2003-Dec-17 16:36:45.78 WUL[setProperty()] Setting property WUL_PARAM_PROPERTIES to F|14|3
    192.168.0.99:Lewis: 2003-Dec-17 16:36:45.88 WUL[getProperty()] Getting property WUL_PARAM_VALUE
    192.168.0.99:Lewis: 2003-Dec-17 16:36:45.88 WUL[getProperty()] Value of WUL_PARAM_VALUE=
    192.168.0.99:Lewis: 2003-Dec-17 16:36:45.98 WUL[setProperty()] Setting property WUL_DESTROY_PARAMLIST to 14
    192.168.0.99:Lewis: 2003-Dec-17 16:36:45.98 WUL[VBeanCommon.eraseFromObjectCache()] Removed cache reference to Object 14
    Lewis Choo Man
    CMIC,
    Canada.

    Hi Manohar,
    You have to give Distribution Key "1" in the Plannner Profile as well as if you take a column for Distribution Key seperately in  your Planning Layout for Cost Element Planning, in the Excel file, you can give Distribution Key as "1" in the respective column. When you upload the data through Excel, the system will take the DKey as "1" only.
    I hope it will solve your problem. Pls revert back for further assistance..
    Srikanth Munnaluri

  • What are the default values for the NetStream.multicast***** properties

    I read the api document about NetStream.multicast**** properties, but found no default values were given. Will the default values be changed when FP10.1 release?? Or, the values are always changing at runtime?
    I have a web-tv application, it broadcast some live videos created by my friends, I think that the latency and lag-time can be bigger in my app, I want to know the recommended default values for the multicast*** properties.
    I think the multicastWindowDuration and liveDelay are the keys. And I am confused between NetStreammulticastWindowDuration and NetStream.bufferTime..they like the same...
    Sorry for my poor english, Thanks.

    the publisher can set the multicast properties you listed to be the defaults for all of the subscribers of the stream.  in addition, the publisher can select whether or not "push" mode is used by changing NetStream.multicastPushNeighborLimit.  setting the limit to 0 disables push, setting it to non-zero enables push in the mesh, but only changes the actual push neighbor limit for the publisher.  if push is enabled for the stream, each peer will use push mode, but will start out with the global default limit (which is currently 4).  this is for safety.  we recommend you always leave push enabled.
    each peer (including the publisher) can change the multicast stream parameters dynamically.  changes are local to that peer.
    for the publisher to set the initial parameters for the stream that all peers will inherit as the default, the parameters must be changed on a new NetStream *before* NetStream.publish() is called.  example:
       var ns:NetStream = new NetStream(netConnection, groupSpecification);
       ns.multicastWindowDuration = 10; // change default for everybody
       ns.publish("mystream");
       ns.multicastWindowDuration = 15; // change window duration just for publisher, everybody else will start with 10 for this stream
    each subscriber can override the multicast stream properties locally, but the overrides must be set on the NetStream *after* receiving a NetStream.MulticastStream.Reset NetStatusEvent.NET_STATUS event in order for the override to stick.  overrides must be reapplied each time the NetStream.MulticastStream.Reset event is received.

  • How to set the default values for fields

    Hi all,
    How to show the default values without changing the existing code in the CO for the seeded page.
    I have requirement like one drown box in that three values are there. On page load the item is empty , but i have to show first value as default value. Is this possible through personalization..
    Can any body have idea pls give some suggession.
    Thanks
    Uma

    Considering you don't want to go for controller extension..
    A way is to use java script in personalization.
    Simply create a RawTextBean using personalization and add the java code to change the properties.
    Java script plan:
    Get the handle of the items to change (like here drop down)
    selectTags=document.getElementsByTagName('select') --gives list of all the select tags in the page
    get ID of the select tag whose value you want to change (loop throug selectTags array).
    or get it directly by getElementsByName method or getElementsByID mETHOD.
    Say its handle is changeItemID.
    changeItemID.selectedIndex=2
    Overview of script
    <SCRIPT type="text/javascript">function _checkLoad(eventXX){
    --yOUR CODE FOR GETTING handle Of the select item whose value is to be changed,goes here...
    changeItemID.selectedIndex=2
    }</SCRIPT>

  • How to get the default value for Distribution key in KP06

    Hi,
    when i enter into the Tcode: KP06, the Default value of Distribution key is 2 but i want to be 1.
    How can i do that...i made entry inthe user profile like this
    GSP     1     G/L Distribution key
    but still i am not getting
    Thanks in Advance

    Hi Manohar,
    You have to give Distribution Key "1" in the Plannner Profile as well as if you take a column for Distribution Key seperately in  your Planning Layout for Cost Element Planning, in the Excel file, you can give Distribution Key as "1" in the respective column. When you upload the data through Excel, the system will take the DKey as "1" only.
    I hope it will solve your problem. Pls revert back for further assistance..
    Srikanth Munnaluri

  • How to make New Folder command available as No as the default value for document libraries

    Hi, is there a way to make this option as No as the default value instead of Yes, for all new document libraries? Perhaps with a powershell command for an entire site collection?

    Hi Cartin,
    I would suggest to create a library template of an empty library with this settings as NO. Use this template for creating new libraries.
    For updating existing libraries you can use:
    $Site = Get-SPSite http://Site
    $ListName = "library Name"
    $Site | Get-SPWeb | ForEach-Object {
    $List = $_.Lists[$listName]
    $List.EnableFolderCreation = $false
    $List.Update()
    $Site.Dispose()
    You can modify the above script for you need.

  • What are the default values for dom.max_chrome_script_run_time for FFVersions 25 through 30 ?

    I have run across issues that creep up. The timeout setting of
    dom.max_chrome_script_run_time
    seems to be 20 seconds in FF 25.0.1 and 10 seconds in FF 30
    I was wondering if you have release notes for all versions from
    [25, 30] so that I can know all of the different timeout values?
    Thanks,
    -Charlie

    Can you post a screenshot that shows a different default value of one of those prefs?
    Note that it is possible to modify the default value via a mozilla.cfg file in the Firefox program folder.
    See:
    *http://kb.mozillazine.org/Locking_preferences
    *http://mike.kaply.com/2012/03/16/customizing-firefox-autoconfig-files/

Maybe you are looking for