Date comparision - urgent

Hi Experts,
I have a requirement where i need to count the no. of  operands that are active at the user entered report to date.
(Logic = operands valid to is  greater than or equal to Report to date user entry variable)
operands valid to date = iam capturing it using a formula variable replacement path and dimension as Date (ZValidto).
User entry Report to date = iam capturing it using the customer exit variable and dimension as Date(ZRTDEX).
Calculated KF(No.of Operands) = (ZValidto >= ZRTDEX) * DataRecordCounter
The above logic works fine for few records but not for all of them.
Thanks in advance.
points will be assigned.
sam.

A DATE column does not have a format-- it is stored in the same packed binary format. Date format masks are only important when you go to convert a date to a string for display.
If you want to ignore the time component of the date, you would need to TRUNC your date, i.e.
SELECT C.idnumber,A.fullname, A.description
  FROM Contact C,
       Action A
WHERE TRUNC(c_date) = to_date('02/16/2009', 'mm/dd/yyyy')
   AND C.actioncode = A.code ;Of course, this will prevent Oracle from using an index on C_DATE. The solution to this is to create a function-based index on TRUNC( c_date ), i.e.
CREATE INDEX idx_trunc_cdate
  ON contact ( TRUNC( c_date ) );Oracle would then be able to use the new index IDX_TRUNC_CDATE for your query. If all your queries want to ignore the time component, you may want to evaluate whether you can get rid of the index on C_DATE alone.
Justin

Similar Messages

  • Current Year and Previou year Data comparision - Urgent

    Hi Experts,
    In our report we need to compare the sales value for current year and prevous year.
    The Fiscal year is the input selection field.
    Output report displayed as below
    Product|Current year sales|Previous year sales|
    404    |120.00          |20.00
    400    |122.00          |22.00
    Total  |242.00          |42.00
    Could any body help how do i use the fiscal year/period or fiscal year for the current sales and previous sales values.
    Thanks in advance.
    Mahantesh

    You have to restricit current year column with the variable Fiscal year and previous year colum with same variable with offset -1.
    For year period use a range with from valie '001.1990' and to value a variable for current and the same variable with offset -12 for previous.
    Hope it helps.
    Regards

  • Help me in date comparision Please !!! urgent.

    Hi ,
    I am trying to retrieve some entries from a table for a selected date.
    Here is the quest I am running .
    SELECT C.idnumber,A.fullname, A.description FROM Contact C, Action A WHERE TO_CHAR(c_date,'mm/dd/yyyy')='02/16/2009' AND C.actioncode = A.code ;
    This statement is correct . But the abouve query is not using the index which defined on c_date as it is enclosed with TO_CHAR .
    Can any one tell me how can I alter the above query such that it use the index & gives me data for a user selected date.
    Please share if you have any ideas & help me out to sort the issue.
    -Meena

    A DATE column does not have a format-- it is stored in the same packed binary format. Date format masks are only important when you go to convert a date to a string for display.
    If you want to ignore the time component of the date, you would need to TRUNC your date, i.e.
    SELECT C.idnumber,A.fullname, A.description
      FROM Contact C,
           Action A
    WHERE TRUNC(c_date) = to_date('02/16/2009', 'mm/dd/yyyy')
       AND C.actioncode = A.code ;Of course, this will prevent Oracle from using an index on C_DATE. The solution to this is to create a function-based index on TRUNC( c_date ), i.e.
    CREATE INDEX idx_trunc_cdate
      ON contact ( TRUNC( c_date ) );Oracle would then be able to use the new index IDX_TRUNC_CDATE for your query. If all your queries want to ignore the time component, you may want to evaluate whether you can get rid of the index on C_DATE alone.
    Justin

  • Date comparision not working in BI-Publisher in one scenario.

    Hi,
    Iam using sqlquery as a datamodel for BI-Publisher report. I have a requirement that the input parameters startdate and endate are Date types. When the user enters startdate and enddate and clicks on view, the report should show data which falls in between those dates.
    Here is the sample query i used.
    select * from
    table1
    where begintime >= :p_StartDate and begintime <=:p_EndDate
    Here begintime is a timestamp and p_StartDate and p_EndDate are just dates. So when comparing begintime with p_StartDate/p_EndDate, i guess its taking default time from that date and because of that the comparision is failing in 1 case. i.e, In the above query, though the comparision operator is >= or <= , ultimately > or < is getting effective. So to acheive the actual result, I need to give one day more for start and end dates.
    However I found a way to acheive this without adding extra day to both the dates. Here it is :
    select * from table1 where
    ( begintime >= to_timestamp(to_char(:p_StartDate) || '00 00 00', 'DD Mon YYYY HH24 MI SS')) and
    ( begintime <= to_timestamp(to_char(:p_EndDate) || '23 59 59', 'DD Mon YYYY HH24 MI SS'))
    But the above is working in sqleditor like jdeveloper database navigator. But not working in BI-Publisher.
    BI-Publisher is throwing error saying
    "ORA-01830: date format picture ends before converting entire input string"
    Please help as to how to go about this problem or any alternative solution.
    Thanks & Regards,
    -Vijay-

    Hi,
    I think it will be fine to trunc the begin time since :p_StartDate and p_EndDate are just dates without time stamp
    i.e:
    select * from
    table1
    where trunc(begintime) >= :p_StartDate and trunc(begintime) <=:p_EndDate;
    any problem with this.Please share the thought.
    Best Regards,
    mahi

  • Duplicate records found while loading master data(very urgent)

    Hi all,
    One infopackage in the process chain failed while laoding the master data(full update).Its showing the following error-->duplicate record found ..1 record used in /BI0/PTCTQUERY and the same record occured in /BI0/PTCTQUERY tables.
    can anyone give me the solution...its very urgent...
    Thanks & Regards,
    Manjula

    Hi
    You can see the check box in the Processing tab page. Make a tick mark for the check box Ignore Duplicate Data Records indicator . When multiple data records that have the same key are transferred, the last data record in the request is updated to BI. Any other data records in the request with the same key are ignored.
    Help says that:
    To maintain consistency, ignoring duplicate data records is only possible if the data is updated serially. A serial update is when data is first updated into the PSA then, after it has been successfully written to the PSA, it is updated into the master data or text tables of the InfoObject.
    If a DataSource transfers potentially duplicate data records or if you manually set the Ignore Duplicate Data Records indicator, the PSA Only update type is automatically selected in the scheduler.
    hope it clears ur doubt, otherwise let me know.
    Regards
    Kiran

  • Problem in Uploading Excel Data ! - Urgent

    Dear Experts,
    I am uploading excel data using FM 'TEXT_CONVERT_XLS_TO_SAP' , its directly convert data and store in internal table same as in excel sheet(row , column wise).
    But the problem is , one of the column having description more then 500 characters. so while uploding excel to itab its truncating the text and only uploding 255 characters.
    Is there any other way , so that i can upload more then 500 characters long text. Also i have tried 'ALSM_EXCEL_TO_INTERNAL_TABLE' FM , it was also not working.
    Please Help me , its Urgent.
    Points will be rewared.
    Thanks & Regards,

    Hi,
    Please use FM 'GUI_UPLOAD'.
    types: begin of ttab,
           rec(1000) type c,
           end of ttab.
    types: begin of tdat,
           fld1(10) type c,
           fld2(10) type c,
           fld3(10) type c,
           end of tdat.
    data: itab type table of ttab with header line.
    data: idat type table of tdat with header line.
    data: file_str type string.
    parameters: p_file type localfile.
    at selection-screen on value-request for p_file.
      call function 'KD_GET_FILENAME_ON_F4'
           exporting
                static    = 'X'
           changing
                file_name = p_file.
    start-of-selection.
      file_str = p_file.
      call function 'GUI_UPLOAD'
           exporting
                filename                = file_str
                filetype                = 'ASC'
           tables
                data_tab                = itab
           exceptions
                file_open_error         = 1
                file_read_error         = 2
                no_batch                = 3
                gui_refuse_filetransfer = 4
                invalid_type            = 5
                no_authority            = 6
                unknown_error           = 7
                bad_data_format         = 8
                header_not_allowed      = 9
                separator_not_allowed   = 10
                header_too_long         = 11
                unknown_dp_error        = 12
                access_denied           = 13
                dp_out_of_memory        = 14
                disk_full               = 15
                dp_timeout              = 16
                others                  = 17.
    Best regards,
    Prashant

  • SQL Loader Oracle 10g problem in upload date with time data -- Very urgent.

    Hi
    I am trying to upload data using SQL loader. There are three columns in the table
    defined as DATE. When I tried upload a data like this '2007-02-15 15:10:20', it is not loading time part. The date stored as 02/15/2008' only. There is not time on that. I tried with many different format nothing work. Can please help me ?
    I have also tried with to_date --> to_timestamp it did not work.
    The application is going to be in production, I cannot change DATE to TIME STAMP. This is very urgent.
    LASTWRITTEN "decode(:LASTWRITTEN,'null',Null, to_date(:LASTWRITTEN,'YYYY-MM-DD HH24:Mi:SS'))",
    CREATEDON "decode(:CREATEDON,'null',Null, to_date(:CREATEDON,'YYYY-MM-DD HH24:Mi:SS'))",
    LASTUPDATEDON(21) "decode(:LASTUPDATEDON,'null',Null, to_date(:LASTUPDATEDON(21),'DD/MM/YYYY HH24:MI:SS'))"

    Your problem is most likely in decode - the return type in your expression will be character based on first search value ('null'), so it will be implicitly converted to character and then again implicitly converted to date by loading into date column. At some of this conversions you probably are loosing your time part. You can try instead use cast:
    SQL> desc t
    Name                                      Null?    Type
    LASTWRITTEN                                        DATE
    CREATEDON                                          DATE
    LASTUPDATEDON                                      DATE
    SQL> select * from t;
    no rows selected
    SQL> !cat t.ctl
    LOAD DATA
    INFILE *
    INTO TABLE T
    TRUNCATE
    FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' TRAILING NULLCOLS
    LASTWRITTEN
    "decode(:LASTWRITTEN,'null',cast(Null as date),
      to_date(:LASTWRITTEN,'YYYY-MM-DD HH24:MI:SS'))",
    CREATEDON
    "decode(:CREATEDON,'null',cast(Null as date),
      to_date(:CREATEDON,'YYYY-MM-DD HH24:MI:SS'))",
    LASTUPDATEDON
    "decode(:LASTUPDATEDON,'null',cast(Null as date),
      to_date(:LASTUPDATEDON,'DD/MM/YYYY HH24:MI:SS'))"
    BEGINDATA
    2007-02-15 15:10:20,null,null
    null,2007-02-15 15:10:20,null
    null,null,15/02/2007 15:10:20
    SQL> !sqlldr userid=scott/tiger control=t.ctl log=t.log
    SQL*Loader: Release 10.2.0.3.0 - Production on Fri Feb 29 00:20:07 2008
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    Commit point reached - logical record count 3
    SQL> select * from t;
    LASTWRITTEN         CREATEDON           LASTUPDATEDON
    15.02.2007 15:10:20
                        15.02.2007 15:10:20
                                            15.02.2007 15:10:20Best regards
    Maxim

  • Sql date comparision

    hello
    i am using oracle 8.1.7..i am new to oracle
    i have a date column in the table, i need to get this date and check whether this date is a sunday or saturday, if they are i need to make this date to next business day (i.e monday-friday),
    i also need to check whether this date falls on last day of month and then make this date as next month first day.
    i am able to write a pl/sql program and compare the date using to_char(date,'d') and last_day(date).
    can this be achieved in a sql select statement.
    actually this date needs to be concatened with other values i am getting from the table. other values i am getting in select statement using ||..
    i tried but i could not find how i could create a if then comparision in a sql select statement.
    please give any suggestions...
    thanks in advance...

    These two expressions should do the date conversions. How you combine them depends which one you want to do first and what the rest of your query looks like
    date + decode(to_char(date,'DY'),'SAT',2,'SUN',1,0)
    date + decode(to_char(date+1,'DD'),'01',1,0)

  • SE14 data recovery(Urgent)

    Hi Guys,
    Is there a way to recover the data deleted from SE14?
    I was trying to delete one of my temp. tables and SE14 was holding the name from a earlier visit.I made a silly mistake and did not pay attention to the name and clicked the delete button.
    Can someone advice please...this is urgent...
    Thanks

    Well, I guess you'll just have to live with the basis folks' answer (that's what I would have expected anyway).
    What instance are you talking about, DEV, QAS, PRD?
    Maybe your company has a sandbox that could be used for the restore? From there you could pull table and data with a transport and re-import it back to your original system.
    Technically possible but I am not sure whether your basis folks would allow a transport from a sandbox into any other system within the transport route.
    Guenther

  • Table Data Transportation (Urgent)

    Hi Experts,
    Can you do me a favour, I can transport table structure from one client to another. but I want to transport my development client table data to production clinet. How can I do it?
    Waiting for your reply with positive hope. it is Urgent.
    with warm Regards
    Rajiv singh

    Hi..
    U need to upload the data into the database table in production separately..
    Do one thing..
    Create a transaction(program) which will upload the text file data into the database table.
    Transport this TCODE to production...and in production run this TCODE...specify filename an data will be uploaded to respective database table.
    Use GUI_UPLOAD function module for the same.
    Regards,
    DJ.

  • Vendor master data upload-Urgent

    Hi all,
    I am using LSMW to upload vendor master data. It is giving some errors as " Function Code cannot be selected". When i try to run through "Display all screens", it is accecpting the data. but when I try to go with E or N mode, it is giving errors.
    I found a note for this also, but that is for manual recording. I am using std program for Batch Input.
    One more strange thing is happening. One field of recon. acc is getting uploaded, converted. I can see the data in " display converted data" , and also in debugging. But when i run the batch input session, Mode 'A', the value is not posted in the field. when i manually give, it accecpts.
    Any help on this is appriciated. Its urgent 
    Thanks.

    Hi all,
    I am using LSMW to upload vendor master data. It is giving some errors as " Function Code cannot be selected". When i try to run through "Display all screens", it is accecpting the data. but when I try to go with E or N mode, it is giving errors.
    I found a note for this also, but that is for manual recording. I am using std program for Batch Input.
    One more strange thing is happening. One field of recon. acc is getting uploaded, converted. I can see the data in " display converted data" , and also in debugging. But when i run the batch input session, Mode 'A', the value is not posted in the field. when i manually give, it accecpts.
    Any help on this is appriciated. Its urgent 
    Thanks.

  • When is the ipod touch 6 release date? urgent

    urgent- need to know asap

    Hey Anniejan, "Tomorrow!!" No, not really, just screwing with you. As Niel stated this is the last place Apple will release information about release dates. If you need a new device, "urgent", then your looking at an iPhone or the latest iPad, otherwise it's a dated iPod 5. But the later in the year it gets the less likely there will be a release at all. If you need more information now, try goggle and see what the rumor mill has to say about a release, but there has been nothing official from Apple, in other words, "Your guess is as good as anyone else's." Good luck, Cheers.

  • R12 Check Printing Need XML output for seeded data definition--urgent

    Hi--
    I really need to get ahold of the XML output from the checks running off the data definition called "Oracle Payments Funds Disbursement Payment Instruction Extract 1.0" in Oracle R12 quickly--particulary the XML tag that holds the MICR string (should be the concatenation of Check Number, Routing and Acct number).
    I found an entry here in the forums about running a query of:
    SELECT XMLType.getClobVal(instruction)
    FROM IBY_XML_FD_INS_1_0_V
    WHERE rownum =1 ;
    to get the entire XML output. I have an open SR but haven't really gotten anywhere with it yet.
    However, all we get back is an error about datatype. Could someone please help out with this--it is quite urgent as I need to finish this last piece of the checks and work with the bank on formatting this week.
    Thanks--I'd really appreciate any assistance!
    Kate

    SELECT XMLType.getClobVal(instruction)
    INTO x_extract_doc
    FROM iby_xml_fd_ins_1_0_v
    WHERE payment_instruction_id = p_payment_instruction_id;
    or you can use
    SELECT document FROM iby_trxn_documents order by creation_date desc;
    provided that the last run was urs.

  • Data mart - Urgent

    Hi Friends
    I have ODS1 and ODS2 loading from R/3.ODS1 is daily load and ODS2 is monthly load.On ODS1 i have fields Property number and InspDate and On ODS2 i have proerty number and 0FISCPER.
    Now i need to update from ODS1 into ODS2.Now how can i map the fields on update raule.Must i map property number as well and only Those 2 fields which i want to update.
    Thanks.
    Regards,
    Chama.

    Hi
    Property numbers are not same on ODS's.Some property numbers are in ODS1 but on ODS2.
    Interms of date,I load for ODS2 on 2nd of every month and daliy for ODS1.Now on ODS1 new changes will load onto it.
    Let say one entry changed 1st of the month and laoding data on 2nd then i don't want to update the changes made after month end(30 or 31st).
    Please advise me.
    It's very urgent.
    Thanks.
    regards,
    Chama.

  • Data conversion (urgent)

    Hi all,
    i'd to know why i've got all my é to i when i've inserted data with unix script ?
    enven though i've converted them from Dos to Unix before ftp and ftp in binary ?
    Thanks in advance,

    Hey, keep cool here...<br>
    This forum is based on volunteers, which are not paid for answer.<br>
    So, if you have not the time to read the doc for which someone give you the link, nobody will make it for you, and if your pb is urgent (as your thread title mentionned), pay yourself a consulant, or raise a SR through metalink.<br>
    <br>
    Very best regards,<br>
    <br>
    Nicolas.<br>
    <br>
    Try your chance into Globalization Support<br>
    Message was edited by: <br>
    N. Gasparotto<br>
    <br>

Maybe you are looking for

  • How do you open the DVD tray on a K430 without using Windows Explorer?

    How do you open the DVD tray on a K430 without using Windows Explorer? I can't find a button on or below the door.  Am I missing something?  Additionally, will the K430 boot from a DVD/CD if it finds one in the DVD tray instead of the hard disk?  Ple

  • Discrepancy in the table payr, need urgent help

    Dear All, i have one table payr in logical database. 2 fields of it i,e kunnr and vblnr When i goto se16 and select the data for say kunnr = '2901350' and vblnr = '20002000' Now what happens for this combination i get no data found. but say i enter o

  • I can't send message to some contact but they can sent me message Blackberry Pearl3g 9105

    Blackberry Pearl3g 9105 I can't send message to some contact but they can sent me message. when they send me message I receive it but when I send them message it shows the sign X in red  Please help 

  • Which PC should I buy?

    Hello~ I want to buy a desktop PC or an All-in-one PC recently, but I don't know which one should I buy? I have a monitor and keyboard+mouse, maybe Nightblade B85 or Z97 is suitable for me, but is it have wireless network?  According to that, I consi

  • Displaying TOC topics in frame

    Using RoboHelp X5, I've created a frameset comprising two frames - a static no scroll top frame and a dynamic bottom frame which must display the topic clicked on the TOC. When I click a TOC topic in the compiled Help, it opens in the bottom frame an