Facing problem with a date column in select query

Hi,
I am facing problem with a date column. Below is my query and its fainling with " invalid number format model" .
Query: SELECT *
FROM EMP
WHERE trunc(LAST_UPDATED) >= to_date(to_char(22-05-2009,'dd-mm-yyyy'),'dd-mm-yyyy')
LAST_UPDATED column is "DATE" data type.
Please help me Thanks

Radhakrishna Sarma wrote:
SeánMacGC wrote:
WHERE LAST_UPDATED >= to_date('22-05-2009','dd-mm-yyyy');
You do not need the TRUNC here in any case.
I don't think so. What if the user wants only data for 22nd May and the table has records with date later than 22nd also? In that case your query willl not work. In order for the Index to work, I think the query can be written like this I think Sean is right though. Use of TRUNC Function is quiet useless based on the condition given here, since the to_date Function used by OP will always point to midnight of the specified date, in this case 22-05-2009 00:00:00.
Regards,
Jo
Edit: I think Sean proved his point... ;)

Similar Messages

  • Facing lot of problems with the DATA object  -- Urgent

    Hi,
    I am facing lot of problems with the data object in VC.
    1. I created the RFC initially and then imported the data object in to VC. Later i did some modifications to RFC Function module,and when i reload the data object, I am not able to see the new changes done to RFC in VC.
    2. Even if i delete the function module, after redeploying the IVIew, results are getting displayed.
    3. How stable is the VC?
      I restarted the sql server and portal connection to R3 is also made afresh.... still i am viewing such surprise results..
    please let me know what might be the problem.

    Hi Lior,
    Are u aware of this problem.
    If yes, please let me know...
    Thanks,
    Manjunatha.T.S

  • Facing problem with logo in the PDF attachment when sending mail...

    hi friends,
    i'm facing problem with logo in the PDF attachment to the mail.
    my requirement:
    1. enter spool number and mail id in the selection screen.
    process:
    1. now the program will fetch the spool data and converts it to PDF.
    2. but when i'm trying to send mail with this PDF as attachment.
    when i open the PDF file from the mail, logo is not coming properly (looks disturbed).
    can anyone help me how to resolve this issue...
    thanks in advance, murashali.

    hi dinakar, thanks for your mail...
    logo looks good in spool/script/smartform.
    even it look good when i download this spool to pdf and to the presentation server as pdf file.
    i'm using CONVERT_OTFSPOOLJOB_2_PDF.
    when i used CONVERT_ABAPSPOOLJOB_2_PDF, is gives a msg - 'spool number not found'.
    here i'm using folloing code to pass pdf to the function module: SO_NEW_DOCUMENT_ATT_SEND_API1.
    code:
    Transfer the 132-long strings to 255-long strings
      lt_mtab_pdf[] = pdf[].
      LOOP AT lt_mtab_pdf INTO lwa_mtab_pdf.
        TRANSLATE lwa_mtab_pdf USING ' ~'.
        CONCATENATE lv_gd_buffer lwa_mtab_pdf INTO lv_gd_buffer.
        CLEAR lwa_mtab_pdf.
      ENDLOOP.
      TRANSLATE lv_gd_buffer USING '~ '.
      DO.
        lwa_mess_att = lv_gd_buffer.
        APPEND lwa_mess_att TO lt_mess_att.
        CLEAR lwa_mess_att.
        SHIFT lv_gd_buffer LEFT BY 255 PLACES.
        IF lv_gd_buffer IS INITIAL.
          EXIT.
        ENDIF.
      ENDDO.
    NOTE: problem i believe is with ''.  i'm getting this tilt symbol () in my pdf internal table.  here in the above code the line   TRANSLATE lv_gd_buffer USING '~ ' is changing the existing tilt to space.  so my logo is getting disturbed.
    even i tried with REPLACE this tilt with other char, but it doent work.
    can you give any idea...

  • Problem with order data

    Hi, I have a problem with order data. A string column has these values:
    A....
    B....
    PSTA-FRA
    PSTA+FRA
    Q....
    R....
    If i order data directly from db ( select column1 from table order by column1 ) , i obtain this result:
    PSTA-FRA
    PSTA+FRA
    If i create a simple report on that table and order on that column the result is:
    PSTA+FRA
    PSTA-FRA
    I can obtain correct output if I set parameter 'Perform group on server' but if i write a selection formula :
    {table.column} >= 'PSTA+FRA'
    record containing PSTA-FRA value not appear.
    I've tried both with Crytal 8.5 and Crystal 11 R2 sp6, database is Sybase SQL Anywhere odbc connection.
    Thanks in advance

    Ordering is done according to the ASCII values of the characters.
    In R2 create a new report and log onto your DB and select Command for your data source. Paste in the SQL you use to get the data in the order the server users. Then you don't have to use CR to do the sorting. DB Servers are much more efficient at collecting the data than CR is.
    Thank you
    Don

  • Algning new folder with other data columns in a document library

    Hi All,
    I have created an InfoPath form that used to create a new form & a new document library and the description to that folder.
    Now my InfoPath form has some text boxes to store data. Also there is an attachment control to upload documents. These documents should be uploaded to the newly created folder.
    The new folder should display at the document library as in the same row with other data columns that were inserted to the data library. I have the problem with the new folder aligning in the same row with other data.
    So if someone can know how to solve this matter please enlighten me.
    Thank You,
    Chiranthaka.

    Can you provide more detail on what exactly you need to achieve and how your system is functioning at the moment? It sounds like you have an Infopath form that can have documents attached to it, you then store these documents into a new folder and wish to
    have the folder represented in the list view for the form in the form library you are using?

  • Problem with loading data to Essbase

    Hi All,
    I have a problem with loading data into Essbase. I've prepared maxl script to load the data, calling rule file. The source table is located in RDBMS Oracle. The script works correctly, ie. generally loads data into Essbase.
    But the problem lies in the fact, that after deletion of data from Essbase, when I'm trying to load it again from the source table I get the message: WARNING - 1003035 - No data values modified by load of this data file - although there is no data in Essbase... I've also tried to change the mode of loading data from 'overwrite' to 'add to existing values' (in rule file) but it does'nt help ... Any ideas what can I do?

    Below few lines from EPM_ORACLE_INSTANCE/diagnostics/logs/essbase/dataload_ODL.err:
    [2013-09-24T12:01:40.480-10:01] [ESSBASE0] [AGENT-1160] [NOTIFICATION] [16][] [ecid:1379989900303,0] [tid:1116830016] Received Validate Login Session request
    [2013-09-24T12:01:40.482-10:01] [ESSBASE0] [AGENT-1001] [NOTIFICATION] [16][] [ecid:1379989900303,0] [tid:1114724672] Received client request: Get App and Database Status (from user [admin@Native Directory])
    [2013-09-24T12:01:54.488-10:01] [ESSBASE0] [AGENT-1001] [NOTIFICATION] [16][] [ecid:1379989900303,0] [tid:1101564224] Received client request: MaxL: Execute (from user [admin@Native Directory])
    [2013-09-24T12:01:54.492-10:01] [ESSBASE0] [AGENT-1001] [NOTIFICATION] [16][] [ecid:1379989900303,0] [tid:1115777344] Received client request: MaxL: Describe (from user [admin@Native Directory])
    [2013-09-24T12:01:54.492-10:01] [ESSBASE0] [MLEXEC-2] [NOTIFICATION] [16][] [ecid:1379989900303,0] [tid:1115777344] Output columns described
    [2013-09-24T12:01:54.494-10:01] [ESSBASE0] [AGENT-1001] [NOTIFICATION] [16][] [ecid:1379989900303,0] [tid:1102616896] Received client request: MaxL: Define (from user [admin@Native Directory])
    [2013-09-24T12:01:54.494-10:01] [ESSBASE0] [AGENT-1001] [NOTIFICATION] [16][] [ecid:1379989900303,0] [tid:1102616896] Received client request: MaxL: Fetch (from user [admin@Native Directory])
    [2013-09-24T12:01:54.494-10:01] [ESSBASE0] [MLEXEC-3] [NOTIFICATION] [16][] [ecid:1379989900303,0] [tid:1102616896] Record(s) fetched
    [2013-09-24T12:01:54.496-10:01] [ESSBASE0] [AGENT-1001] [NOTIFICATION] [16][] [ecid:1379989900303,0] [tid:1116830016] Received client request: MaxL: Fetch (from user [admin@Native Directory])
    [2013-09-24T12:01:54.498-10:01] [ESSBASE0] [AGENT-1160] [NOTIFICATION] [16][] [ecid:1379989900303,0] [tid:1114724672] Received Validate Login Session request
    [2013-09-24T12:01:54.499-10:01] [ESSBASE0] [AGENT-1001] [NOTIFICATION] [16][] [ecid:1379989900303,0] [tid:1101564224] Received client request: Get Application State (from user [admin@Native Directory])

  • Problem with the date conversion

    Hi Friends,
    i am facing the problem with the date conversion,  Actuall my requirement is to pass the date to the screen based on the user setting roles(SU01).
    I have fetched the user setting date format by using the funciton module SUSR_GET_USER_DEFAULTS, The function module picks the exact user date setting (Like as MM/DD/YYYY, MM.DD.YYYY, DD.MM.YY).
    After that i have implemented the FORMAT_DATE_4_OUTPUT funciton module for converting of the user role setting date format into system  date format.
    for the english language case the funciton module FORMAT_DATE_4_OUTPUT works fine but the funciton module not supported for other languages
    Can you please provide the Function Moudle for user setting date conversion.
    The funciton module is most important for us,
    Thanks
    Charan
    Moderator message: date conversion questions = FAQ, please search before posting.
    Edited by: Thomas Zloch on Dec 21, 2010 2:19 PM

    Hope this logic helps you.
    DATA LF_DATE    TYPE DATS VALUE '21122010'. " 21-dec-2010
    DATA LF_DATE_BI(10).
    WRITE LF_DATE TO LF_DATE_BI.  "Now LF_DATE_BI contains the date in user format
    "Now populate the value LF_DATE_BI to the screen field

  • Urgent: Facing problem with restoratio​n prosses

    Good day,
    I'm Facing problem with restoration process. During restoring my data from my PC to my Q10 phone using link app. the application reject my request & kept giving me following error:
    Operation Cancelled.
    Really need your help Gent’s & I'll be so much glad for anyone help me to solve this matter.
    Thx.

    Hello
    Are you restoring from same device to same device or to different device?

  • PSP: problems with viewing data

    Hello.
    I'm currently working at on-line shop and have some problems with viewing data from database. When there is no much inserts to table its working very well. But after inserting all Inserts I have its acting weird.
    Sample with 10 INSERTS:
    http://gafgarion.atspace.com/psp/1.jpg
    Sample with 100 INSERTS:
    http://gafgarion.atspace.com/psp/2.jpg
    I'm using Oracle 9i. when I have more data in my database its acting weird. There is SELECT only from one table, but sometimes I have data from other tables aswell.
    I didnt touch any config files or something else. Only created new User and DAD.
    any ideas what should I do to fix that ??
    thnx in advice

    Hello,
    My guess is that you are speaking about PLSQL Server Pages (PSP), and the PLSQL Web Toolkit.
    This is why I do not think that you will have lot of answer since this forum is targeted toward Web Services developer (XML, SOAP, and so on)
    I am inviting you to ask your question on the general Oracle Application Server - General or PLSQL forums.
    Regards
    Tugdual Grall

  • Problems with retrieving data from tables with 240 and more records

    Hi,
    I've been connecting to Oracle 11g Server (not sure exact version) using Oracle 10.1.0 Client and O10 Oracle 10g driver. Everything was ok.
    I installed Oracle 11.2.0 Client and I started to have problems with retrieving data from tables.
    First I used the same connection string, driver and so on (O10 Oracle 10g) then I tried ORA Oracle but with no luck. The result is like this:
    I'm able to connect to database. I'm able to retrieve data but from small tables (e.g. with 110 records it works perfectly using both O10 and ORA drivers). When I try to retrieve data from tables with like 240 and more records retrieval simply hangs (nothing happens at all - no error, no timeout). Application seems to hang forever.
    I'm using Powerbuilder to connect to Database (either PB10.5 using O10 driver or PB12 using ORA driver). I used DBTrace, so I see that query hangs on the first FETCH.
    So for the retrievals that hang I have something like:
    (3260008): BIND SELECT OUTPUT BUFFER (DataWindow):(DBI_SELBIND) (0.186 MS / 18978.709 MS)
    (3260008): ,len=160,type=DECIMAL,pbt=4,dbt=0,ct=0,prec=0,scale=0
    (3260008): ,len=160,type=DECIMAL,pbt=4,dbt=0,ct=0,prec=0,scale=1
    (3260008): ,len=160,type=DECIMAL,pbt=4,dbt=0,ct=0,prec=0,scale=0
    (3260008): EXECUTE:(DBI_DW_EXECUTE) (192.982 MS / 19171.691 MS)
    (3260008): FETCH NEXT:(DBI_FETCHNEXT)
    and this is the last line,
    while for retrievals that end, I have FETCH producing time, data in buffer and moving to the next Fetch until all data is retrieved
    On the side note, I have no problems with retrieving data either by SQL Developer or DbVisualizer.
    Problems started when I installed 11.2.0 Client. Even if I want to use 10.0.1 Client, the same problem occurs. So I guess something from 11.2.0 overrides 10.0.1 settings.
    I will appreciate any comments/hints/help.
    Thank you very much.

    pgoel wrote:
    I've been connecting to Oracle 11g Server (not sure exact version) using Oracle 10.1.0 Client and O10 Oracle 10g driver. Everything was ok.Earlier (before installing new stuff) did you ever try retrieving data from big tables (like 240 and more records), if yes, was it working?Yes, with Oracle 10g client (before installing 11g) I was able to retrieve any data, either it was 10k+ records or 100 records. Installing 11g client changed something that even using old 10g client (which I still have installed) fails to work. The same problem occur no matter I'm using 10g or 11g client now. Powerbuilder hangs on retrieving tables with more than like 240 records.
    Thanks.

  • Facing problem with the code for sending an .xls attachment via email, a field value contains leading zeros but excel automatically removes these from display i.e. (00444 with be displayed as 444).kindly guide .

    Facing problem with the code for sending an .xls attachment via email, a field value contains leading zeros but excel automatically removes these from display i.e. (00444 with be displayed as 444).kindly guide .

    Hi Chhayank,
    the problem is not the exported xls. If you have a look inside with Notepad or something like that, you will see that your leading zeros are exported correct.Excel-settings occurs this problem, it is all about how to open the document. If you use the import-assistant you will have no problems because there are options available how to handle the different columns.
    Another solution might be to get familiar with ABAP2XLS-Project. I got in my mind, that there is a method implemented, that will help you solving this problem. But that is not a five minute job
    ~Florian

  • Problem with universal data cleanse

    I have problem with universal data cleanse.
    I am using DS 3.2.x (12.2.2).
    I created:
    Dictionary: TEST
    Classification: TEST_CL
    Custom outputs: category: TEST_CAT
    Dictionary Entry:
    Primary: BO
    Classification: TEST_CL
    Gender: Unassigned
    Secondary information:
    When used as: TEST_CAT
    Standard: Business Objects
    Rule file:
    DataCleanse Rule File v2.0;
    TEST_CAT = TEST_CL;
    action = TEST_CAT;
    TEST_CAT = 1 : TEST_CAT : 1;
    end_action
    Data Cleanse:
    Input: Multiline1
    Options:
    Parsing Dictionary: TEST
    Rule file: .../test_rules.dat
    Break On Whitespace Only: Yes
    Parser Sequences Multiline1: TEST_CAT
    Output:
    Parent_component: TEST_CAT1
    Generated_field_name: TEST_CAT and RULE_LABEL
    Generated_field_class: parsed/standardized
    Contenet_type: none
    and EXTRA field
    I wanted to replace word u201CBOu201D with the standard words u201CBusiness Objectu201D, but I have result: there is "BO" in the extra field,
    there are "null" in others fields.
    What am I doing wrong?
    Thanks for all help!
    P.S. I don't have cleansing packages installer.

    There seem to be a couple of things going on here:
    1. If you are using your custom dictionaries, then you have to map your input to MULTILINE1 and enable the custom parsers - just something to be aware of
    2. You mentioned that you made some changes to the existing dictionary and you are not seeing any changes. To be clear, do you have different TEST and PRODUCTION environments? Or is it the same environment except that you have a local DS repository and for the dictionary you are pointing to another repository (using Dictionary --> Manage Connections)?
    Having the dictionaries on a different repository should not make any difference as long as you point to them in your designer using the Dictionary --> Manage Connection option.
    So I think there may be some issue with your job setup and/or dictionary values need to be looked at. You can start by adding another output field named "EXTRA" to see whether or not your data is getting parsed at all. Also, make sure the entry "CLEANME" is classified as FIRM_NAME_ALONE in the dictionary and that you are selecting the correct dictionary name in the Datacleanse Transform options.

  • Facing problem in saving data without overlapping in for loop

    Hi,
    I am facing problem in writting data withou overlapping if i run outer loop for 2 or more times and in inner for loop i am getting array in a way I want but when i try to build that array with logging temperature i am not able to do it. Please guide me through ths.
    Thank You
    Hnagpal
    Solved!
    Go to Solution.
    Attachments:
    data storage.vi ‏31 KB
    what i am getting.xlsx ‏10 KB
    what i want.xlsx ‏10 KB

    Thanks odessy27, Matthew Kelton, for replying.
    Matthew Kelton: Thanks for the solution i am adding outer loop so that i can increase the number of row. I am using it for some application which require me to save data several time and i used random number here but originally instead of random number there will be power meter reading and i want to save it every hour and plot it. I am also attaching a file what i made I don't know is this a good way or not. Actually i will also beneeded to plot a graph. But again how to increase a row and without replacing previous data i can write another row.
    Yes i want to make one row for each iteration.
    I attached both files in 2009 version.
    Thank You
    Himanshu Nagpal 
    Attachments:
    desired result.xlsx ‏10 KB
    data storage (1).vi ‏26 KB
    data storage.vi ‏37 KB

  • Facing problems with network due which the phone goes into hangs status

    Facing problems with network due which the phone goes into hangs status.  some one help me with switching between 2g and 3G network

    Hi Mani Nair,
    I apologize, I'm a bit unclear on the exact nature of the issue you are describing. If you are talking about having issues with a 3G cellular data network, you may find the troubleshooting steps outlined in the following article helpful:
    iPhone cellular data connection issues
    Regards,
    - Brenden

  • Problem with creating virtual column

    Hello,
    We've got problem with creating virtual column.
    There is table R_T that contain columns R_ID and L_ID, we would like to create virtual column RL_ID that contains sth like 'R_ID-L_ID' (R_ID, L_ID and RL_ID are varchars).
    According documentation we've tried:
    alter table R_T add column (RL_ID varchar2(60) generated always as (R_ID||'-'||L_ID) VIRTUAL)
    but getting
    ORA-00904: : invalid identifier
    00904.00000 - "%s: invalid identifier"
    Have no idea where is the problem.
    Table, columns names are little different but contains only capital letters A - Z and underscore "_".
    Has anyone idea?
    Thanks a lot.

    Strange...
    This does work for me :
    Connected to Oracle Database 11g Enterprise Edition Release 11.2.0.1.0
    Connected as dev
    SQL>
    SQL> create table r_t (
      2   r_id varchar2(25),
      3   l_id varchar2(25)
      4  );
    Table created
    SQL> insert into r_t (r_id, l_id) values('R','L');
    1 row inserted
    SQL> alter table r_t add (rl_id varchar2(60) generated always as (r_id||'-'||l_id) virtual);
    Table altered
    SQL> select * from r_t;
    R_ID                      L_ID                      RL_ID
    R                         L                         R-L
    SQL>

Maybe you are looking for