Checking Date Format.

Currently I came across a requirement to check the date format of a date stores in VARCHAR2 column.
I don't think this is feasible or not... because if some date is stored like - '01/01/2012' how will I determine it is 'DD/MM/YYYY' or 'MM/DD/YYYY'.
Can anyone tell me if it is possible then how ?
Thanks in advance...

Hi,
See {message:id=4252963} for a couple of ways to see if the string is some valid date. As you said, which valid date is another question.
Information about DATEs should not be stored in VARCHAR2 columns. Use DATE (or TIMESTAMP) columns instead; then Oracle will take care of validating them, and you'll know that all the values in the table are valid.
AChatterjee wrote:
... I don't think this is feasible or not... because if some date is stored like - '01/01/2012' how will I determine it is 'DD/MM/YYYY' or 'MM/DD/YYYY'.Exacltly. There's no way to tell if the person who entered '06/11/12' meant
June 11, 2012,
November 6, 2012,
November 12, 2006,
December 11, 2006,
June 12, 2011, or
December 6, 2011
Even if you know that the last part represents the year, you can't be sure if it's 2012, 1912, or 0012.

Similar Messages

  • Checking date format in XI mapping

    Hi all,
    I have a scenario in which the need arises for checking the date format.The source field has to be checked whether having the format YYYYMMDD.How can I handle this?
    Thanks and Regards,
    Jishi

    Hi
    Write a user defined function
    where u can use the java code
    Format formatter = new SimpleDateFormat("yyyy/MM/dd");
    here u can specify the required date format.
    so ur input will be a string with the date,
    so convert the date string into a Date object and then format the date according to ur need.
    Date dtobj = new Date(strgDate);    //convert the string into date object.
    Format formatter = new SimpleDateFormat("yyyy/MM/dd");    //specify the required format.
    formatter.format(dtobj);    //format ur date
    return dtobj;
    cheers
    jithesh

  • Date format in invoice for

    hi,
    us company code is billing to uk customer and the date format in the oy01 tcode is maintained for uk country as dd.mm.yyyy and for us it s maintained as mm/dd/yyyy now the requirement is if us company code is billing irrespective of the customer, date format for due date(which is calculated by adding the no. of days in the payment terms ) in the invoice should be mm/dd/yyyy but here it is appearing as dd.mm.yyyy as customer belong to uk is there any standard setting where in this requirement can be met, i have also checked date format in su01 for the user id it is not effecting the out come.
    kindly guide.
    thanks

    hi shakeer,
    execute SU01 goto DEFAULTS - there date format will be there.
    please change as per your requriment.
    hope this clears your issue
    balajia

  • Date Format in Check Printed from F110

    Hi,
    I'm on 4.6C.
    Company: US10 (United states local configuration)
    I'm doing the check printing thru Tcode F110 and for printing we are using program RFFOUS_C. Earlier we were getting date format as MM.DD.YYYY but if vendor is form Spain (I'm not sure) I have started getting format as DD/MM/YYYY.
    Why?. Should I change vendor's country to US on Tcode FK03?
    I have checked the user setting (Tcode SU3) of the person who did the printing, in that also the date format is MM.DD.YYYY.
    A lot of thanks in advance.
    Best Regards,

    Hi Sid,
    Thanks for your quick answer.
    My Date's fields in RFFOUS_C are: &REGUH-ZALDT& and &REGUP-BldAT&
    /: SET DATE MASK = 'MM.DD.YYYY'
    OR
    /: SET REGUH-ZALDT MASK = 'MM.DD.YYYY'  ????
    I must set date mask in every window??
    a lot of thanks in advance.
    best regards

  • Date format becomes incorrect when you run check option on portal

    Hi,
    We have a report which has Date variable in selection screen. When we enter selection as interval and then when we click on Check option before executing the report, the date format becomes garbage.
    Here is an example:
    This is what I enter in Date variable :
    Date : 01/01/2001-01/01/2010
    After that when I click on CHECK option, the system automatically converts the first date into garbage value i.e. 01/01/2001 will be converted to 1//20/01/0
    This only happens when we run report in Portal 7.0 When we try to run similar report using default web template of BW 3.5, it works fine.
    Has anybody faced similar problem ? We are on Portal Java SP13 with Patch 6.
    Thanks,
    Parin Gandhi.

    Thanks Frank for a quick reply.
    I have used the SimpleDateFormat for formatting with the pattern as, "MM/dd/yyyy" and it is working fine if user enters 4 digit year.
    However, for a entry with 2 digits for a year e.g. 04/10/07 when i parse the date using SimpleDateFormat,it is giving me date as 04/10/0007.
    Is there a way by means of which i could force the user to enter 4 digits for the year?
    I have tried using dateStyle attribute of <af:convertDateTime> tag with 'shortish' as its value, it converts a 2 digit year into 4digit on the browser side & displays on the screen e.g. if user enters 04/10/07 it will appear as 04/10/2007 on the screen however, in value change listener method, i could see date as 04/10/0007.
    Any help in this regard is highly appreciated.
    Thanks in advance,
    Shriniwas

  • Check the date format

    Hi,
      Can anybody tell me how to check the date format in BDC while updating.
      The system date format is like mm/dd/yyyy. Check the dates format, in case of error return the following message “The date format should be YYYYMMDD”.
    Thanks......

    Dear Anil,
    This is a common problem, when carrying out BDC.
    For example, while recording you met with the field --> MKPF-BUDAT.
    Go to SE11 --> MKPF --> Search for BUDAT --> Double click on the Data Element i.e. BUDAT --> Double Click on the domain DATUM --> You can see under the block Output Characteristics : Output Length = 10.
    While declaring the TYPES Structure, make it CHAR(10).
    Consider this technique as the Rule-of-Thumb while doing BDC.
    Regards,
    Abir
    Don't forget to award points *

  • Date format check

    Hi
    i want to check the date format how can i?
    2007/09/23 like this format or not

    HI Ramesh
    try like thi s
    data: begin of int_bseg occurs 0,
        BELNR LIKE BSEG-BELNR,
        ZUONR LIKE BSEG-ZUONR,
        GJAHR LIKE BSEG-GJAHR,
    end of int_bseg.
    start-of-selection.
    data: lv_date type sy-datum.
    data: lv_date1 type sy-datum.
    data: lv_formatdate(10) type c.
    data: lv_formatdate1(10) type c.
    data: var1(4) type c,
    var2(2) type c,
    var3(2) type c.
    data: 2days_out type sy-datum.
    lv_date = 2days_out.
    var1 = lv_date+(4).
    var2 = lv_date+4(2).
    var3 = lv_date+6(2).
    concatenate var3 var2 var1 into lv_formatdate separated by '/'.
    select zuonr belnr bukrs GJAHR from bseg into
    corresponding fields of  table int_bseg
    where bukrs = 'company code' and
          ZUONR = lv_formatdate.
    Reward all helpfull answers
    Regards
    Pavan

  • How to check the date in the date format

    hi all,
    i am using db10g
    i have to read the data column from some source.
    I should accept as it is and validate whether that date is in the date format how can i validate this condition?
    Thanks..

    user13329002 wrote:
    hi all,
    i am using db10g
    i have to read the data column from some source.
    I should accept as it is and validate whether that date is in the date format how can i validate this condition?
    Thanks..Ask your source what the date format is. If it is constantly changing then the format needs to be transmitted also.
    Imagine a string (that could represent a date) like this:
    10-01-11
    it could mean:
    10th of January 2011
    1st of October 2011
    11th of January 2010
    1st of November 2011
    11th of October 2001 (highly unlikly but still possible).
    How should an automated system decide which is the correct date? You need to establish a rule that includes a date format and therefore returns the correct value. Or even better: Deal with dates, not with strings. This is especially for those Java/VB programmers who have no real clue what a data type is ment for.

  • How to check the calendar date format in R12, 'IW' or 'WW' ??

    Hi!
    Currently we are facing any issue where the first date in 2014 is 6-Jan and remaining dates i.e; 2.3.4.5 Jan are in last week of Dec13.
    I read in Oracle Forums topic first dates in Oracle are based on IW and W W format as below;
    W W format - provides the week number such that January 1 is always in week 1
    'IW format - is a little different in that January 1 can be week 53 of the previous year if it is a Friday, Saturday or Sunday.
    But I am unsure in which format, our customers are maintaining the calendar dates in R12?? So is there any way/script find out the date format??
    They are using 4/4/5 calendar type and Prof option 'BOM: Wek or Period Start Day' is set to Monday.
    If this is not the right community for this discussion, please advise the right community as well.
    Please update!

    Hi,
    Try DATE_CHECK_PLAUSIBILITY FUNCTION.
    PARAMETERS : P_DATE LIKE SY-DATUM.
    START-OF-SELECTION.
    end-of-selection.
    CALL FUNCTION 'DATE_CHECK_PLAUSIBILITY'
      EXPORTING
        DATE                      = P_DATE
      EXCEPTIONS
        PLAUSIBILITY_CHECK_FAILED = 1
        OTHERS                    = 2.
      IF SY-SUBRC <> 0.
        WRITE :/ P_DATE, ' is Invalid Date'.
      ELSE.
        WRITE :/ P_DATE, ' is a valid day'.
      ENDIF.
    If you want the OO way of doing the same, you can use this.
    CALL METHOD CL_RECA_DATE=>CHECK_DATE
      EXPORTING
        ID_DATE      =
    EXCEPTIONS
       DATE_INVALID = 1
       others       = 2
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Internally, it calls the above function module.
    Regards,
    Ravi
    Note : Please close the thread, if the question is answered
    Message was edited by: Ravikumar Allampallam

  • How to convert the numeric to date format

    HI ,
         We have created the date KF and selected the data type as DEC-numeric or counter and add in the cube.
          the data for this fields in the cube are in numerics like  734.504, but when we execute the report it is converted in to date format dd.mm.yyyy.
                    My issue how this conversion is working in the backend while executing the report.
    Regards.
    venkata

    Conversion is happening because of the type you had selected for the KF while creating it.
    Check the type of the Key figure?
    While creating the KF you might have selected the Type as Date and Data type -DEC : Counter or amount field with comma and sign.
    that's the reason why you are getting the output values displayed in dd.mm.yyyy format.
    For amount field - create a KF with type "AMOUNT" and unit -0currency or specify the currency of that region.
    regards
    KP

  • Data format change in bex

    hi friends,
    i have 0date infoobject as one of the fields in a cube. data is uploaded into cube correctly. when i checked data in cube it's in correct format 20.12.2006, but when i checked in bex report it shows 12/20/2006. how to convert it into dd/mm/yyyy or simply day first,month second and year third component format. where i have to routine? suggestion pls..
    thanks,
    raju

    Raju,
    Change default user settings. at TCode: SU01 > User id> Change --> Defaults.
    These changes are User Specific. effects to all reports.
    Hope it Helps
    Srini

  • Date format change

    hi friends,
    i have 0date infoobject as one of the fields in a cube. data is uploaded into cube correctly. when i checked data in cube it's in correct format 20.12.2006, but when i checked in bex report it shows 12/20/2006. how to convert it into dd/mm/yyyy or simply day first,month second and year third component format. where i have to routine? suggestion pls..
    thanks,
    raju

    Hi RAJU,
    change the setting in your report....choose dd/mm/yyyy  format.......as we do in EXCEL sheet
    Right click  on  CELL in ur  report......choose FORMAT CELLS......in NUMBER TAB select date ....change as per requirement
    hope it helps..........
    Regards
    chandra sekhar

  • How to change default Date format in BO 6.5 SP4

    A problem with date display has been reported to me by one of our users -  in BO 6.5 - since installing SP4.
    The default date format is now MM/DD/YYYY
    I have tried to recreate this on my PC and have been able to confirm that this is the case.
    Most of our PC's will have two versions of Business Objects on them - for 5.1.6 and for 6.5 - that is the case for my PC.
    If I create a new BO document based on a spreadsheet with three entries in the spreadsheet as follows:-
    20/01/2009    20-Jan-2009  20th January 2009
    This displays in BO 6.5 as
    1/20/2009   1/20/2009    20th January 2009
    My PC regional setting is UK and the time displays DD/MM/YYYY
    Can you advise how to correct this problem please.

    Hi Sebastien
    Thank you for your response.
    I haven't checked Dimension in universe because this is happening even when datasource is an Excel spreadheet - as per details in previous post.
    I have looked for *.sbo files and found one for ODBC.sbo in the Version 5 folders on PC - with date format details in it which I've changed - that doesn't make any difference.
    Any other ideas?
    Regards
    Linda

  • Problem with date format mask 'D'

    I am experiencing an extremely thorny problem with the date format mask ‘D’. I am trying to use it to check whether today is a Monday. The variable v_temp_day is set to sysdate. For the last 4 weeks the code has behaved erratically – giving a different result at 02:00 than at 10:30 even though it is only taking account of the date. In desperation I inserted a debug statement formatting the date in a variety of ways – with interesting results. Oracle is somehow managing to tell us that today is simultaneously Monday and Tuesday depending on which format mask you choose. Anyone got any thoughts or suggestions?
    PROC_ID TO_CHAR(STAMP_TIM
    EVENT_SQLERRM
    RRHKP010 17092007 02:00:00
    TO_NUMBER( TO_CHAR( v_temp_day, D ) ) = 2. TO_CHAR( v_temp_day, D ) = 2. TO_CHAR( v_temp_day, DY ) = MON. TO_CHAR( v_temp_day, DAY )
    = MONDAY . TO_CHAR( v_temp_day, Day DD-MON-YYYY HH24MISS ) = Monday 17-SEP-2007 020000. TO_CHAR( v_temp_day, D ) = 2.
    SQL> select to_char( sysdate, 'D' ) from dual ;
    T
    1

    My book says the trunc(d,'iw') will return "same day of the week as Jan 1st of that year"It's bad book.
    Please read about [url http://oraclesvca2.oracle.com/docs/cd/B10501_01/server.920/a96540/functions176a.htm#80159]TRUNC & 'IW' Format Model and [url http://oraclesvca2.oracle.com/docs/cd/B10501_01/server.920/a96529/ch3.htm#50331]Database Globalization Support Guide: First Calendar Week of the Year in the manual.

  • Problem with date format from Oracle DB

    Hi,
    I am facing a problem with date fields from Oracle DB sources. The date format of the field in DB table is 'Date base type is DATE and DDIC type is DATS'.
    I mapped the date fields to Date characters in BI. Now the data that comes to PSA is in weird format. It shows like -0.PR.09-A
    I have changing the field settings in DataSource  to internal and external and also i have tried mapping these date fields to text fields with out luck. All delivers the same format.
    I have also tried using conversion routines like, CONVERSION_EXIT_IDATE_INPUT to change format. It also delivers me the same old result.
    If anybody of you have any suggestions or if anybody have you experienced such probelms, Please share your experience with me.
    Thanks in advance.
    Regards
    Varada

    Thanks for all your reply. I can only the solutions creating view in database. I want some solution to be done in BI. I appreciate if some of you have idea in it.
    The issue again in detail
    I am facing an issue with date fields from oracle data. The data that is sent from Oracle is in the format is -0.AR.04-M. I am able to convert this date in BI with conversion routine in BI into format 04-MAR-0.
    The problem is,  I am getting data of length 10 (Output format) in the format -0.AR.04-M where the month is not in numericals. Since it is in text it is taking one character spacing more.
    I have tried in different ways to convert and increased the length in BI, the result is same. I am wondering if we can change the date format in database.
    I am in puzzle with the this date format. I have checked other Oracle DB connections data for date fields in BI, they get data in the format 20.081.031 which will allow to convert this in BI. Only from the system i am trying creating a problem.
    Regards
    Varada

Maybe you are looking for

  • Options for presenting photo's in Nakisa 3.0 Org chart

    We want to add employee photo's into the org chart in Nakisa but currently do not have photo's in SAP R/3. Is this a requirement before Nakisa will display these or can they be accessed by Nakisa if they are stored on a networked server for example w

  • Reformating a 3 GB USB drive into just one partition

    I once tried to plug a 3TB hard drive into my 2008 iMac to discover it wouldn't recognize anything over 2TB. So, I upgraded to 10.8.5.  But evidently, when I originally tried to format the drive, I accidentally created 2 partitions.  When I plug the

  • Continuous timestamp entry to table?

    Hi,         I've been trying to put entries generated randomly into the table with the current time stamp value.         I've done it partially but every new entry is overwritten on the first place only.         Corresponding VI is attached below. Th

  • Where can i access my billing history within the website?

    Our accountant needs receipts and I am told by your staff you no longer email them to subscribers anymore. Where pray-tell may I find it?

  • Replacing an AMD motherboard with a Intel motherboard

    OK after a few problems with my L355D laptop I said that was it I'm going back to an Intel Board...WHILE that is a problem. why will the intel board not even light up as the AMD did.if the battery is the same and the power suppy is the same and the p