Help in date format in dashboard

Hi All:
I am using dashboard prompt for filteration on date. I want default initialization in 'dd-mm-yyyy'. I successfully done it. But when I use calendar then its format is "mm/d/yyyy'. Is it possible to change the format of calendar date in 'dd-mm-yyyy' Pluzz help me in this context.
Thanks
Haroon

Hello Ali,
please let me know, if you have an solution :-)
I figured out, that when you change the country / language, the format will change.
Perhaps this help you.
Regards,
Stefan

Similar Messages

  • Changing Date Format in Dashboard prompt drop down list

    Hi friends, my dashboard shows a drop down list for dates , which are in format "7/1/2008 12:00:00 AM".
    This is defined datetime datatype in sql server. Is there any way to change the date format in dashboard prompt to just "7/1/2008" without doing it in database side.
    Appreciate your help.
    Thanks and regards

    Hi... Toony
    In Dashboard Prompt, you have option to select i.e. show SQL,
    there you write the Logical SQL or Advanced SQL: <em>select cast("timestampCOLUMN" as date) from "PresentationLayerName"</em>
    this is simple way without changing anything in rpd side...
    And if you want the timestamp column somewhere in some reports you can use that column directly.
    If you don't want you need to cast it as DATE.
    If your question was answered then put it as answered and mark it as correct... ;)
    Edited by: Kishore Guggilla on Oct 20, 2008 11:44 PM

  • Problem About Date Format in Dashboard

    Hi All:
    I still have problem about date format in dashboard and dashboard prompt. When I use cast(dealdate as date) in dashboard prompt(coloumn formula of deal_date) and filter view(In edit view of filter coloumn formula) Then It converts the date format from mm/dd/yyyy to yyyy-mm-dd But I want format in dd-mm-yyyy.
    ANd also one problem more that is when I use cast function in filter coloumn formula then how I give alias to it. Because it shows same like that cast(deal_date as date) on dashboard filter view.
    Pluzz help me to solve this problem
    Haroon

    Changing the ini files should change the date format. Have you amended the correct instances of the date format? In dbFeatures there is one for every ODBC connection.
    For example in my DBFeatures.INI
    [ DATA_SOURCE_FEATURE = ODBC_300 ]
    DATE_FORMAT = 'dd-mm-yyyy' ;
         TIME_FORMAT = 'hh:mi:ss' ;
         DATE_TIME_FORMAT = 'dd-mm-yyyy hh:mi:ss' ;
         IDENTIFIER_QUOTE_CHAR = '"';Also a file on the presentation side in OracleBI \web\Config called localedefinitions.xml.
    Inside that there appears to be defaults for localisations - maybe it is possible to amend your locale in the Administration settings of the dashboard.
    However, I haven't tried this sorry.

  • Date format problem - dashboard prompt - presentation variable

    Hi,
    I've created a dashboard prompt on a date and defined a presentation variable.
    In my report I make use of the following object : TimeStampAdd(SQL_TSI_MONTH,-12,date '@{pv_afw_start_date}' )
    My report works when making use of a drop down list, but when I want to make use of a calendar to select from, I receive the following error
    *A general error has occurred. [nQSError: 46047] Datetime value 17/11/2009 from 17/11/2009 does not match the specified format. (HY000)*
    Is there a difference in the date formats used by the prompt type (drop down list, calendar, ..)? And how you can align them..
    Txs for your help.
    Kr
    A

    Timestampadd ask for a timestamp not for a date.
    Check here :
    http://download.oracle.com/docs/cd/E12103_01/books/admintool/admintool_SQL14.html
    The syntax is :
    TimestampAdd(SQL_TSI_DAY, 3, TIMESTAMP '2000-02-27 14:30:00')You may have to change your prompt to retrieve a timestamp.
    Where do you use your formula ? In a formula column ?

  • Pls Help with date format picture ends ......error

    Hi Everyone,
       I am getting the following error when I run my crystal report.
    Failed to retrieve data from the database.
    Details: HY000:[DataDirect][ODBC Oracle driver][Oracle]ORA-01830: date format picture ends before converting entire input string
    [Database Vendor Code: 1830]
       I am using SQL Command for my report and in the command  my date fields are of "Date" datatype.
       I am using Crystal Reports XI R2,driver - CR Oracle ODBC Driver 5.1
       Any help is greatly appreciated.
    Thanks in advance
    My SQL Command is as follows:
    <
    with MAXNEWSTAT as
    (select
    /--Added by HAN--/
    HRHISTORY.COMPANY,
    HRHISTORY.EMPLOYEE,
    MAX(HRHISTORY.ACT_OBJ_ID) ACT_OBJ_ID
    FROM
    LAWSON.HRHISTORY
    WHERE
    HRHISTORY.FLD_NBR=20
    and TO_DATE(HRHISTORY.DATE_STAMP)
        >= TO_DATE((TO_CHAR((ADD_MONTHS(SYSDATE,-1)),'YYYY/MM')||'/01'),'YYYY/MM/DD') 
        AND  TO_DATE(HRHISTORY.DATE_STAMP) <= (TO_DATE((TO_CHAR((ADD_MONTHS(SYSDATE,0)),'YYYY/MM')||'/01'),'YYYY/MM/DD'))-1
    /--Added by HAN--/
        GROUP BY COMPANY,
        EMPLOYEE),
    NEWSTAT AS
    (SELECT
    /--Added by HAN--/
    HRHISTORY.COMPANY,
    HRHISTORY.EMPLOYEE,
    HRHISTORY.A_VALUE,
    HRHISTORY.DATE_STAMP,
    HRHISTORY.BEG_DATE,
    HRHISTORY.ACT_OBJ_ID NS_OBJ_ID,
    HRHISTORY.SEQ_NBR
    FROM
    LAWSON.HRHISTORY
    INNER JOIN LAWSON.MAXNEWSTAT
    ON
    /--Added by HAN--/
    HRHISTORY.COMPANY = MAXNEWSTAT.COMPANY
    /--Added by KAM--/
    AND HRHISTORY.EMPLOYEE = MAXNEWSTAT.EMPLOYEE
    AND HRHISTORY.ACT_OBJ_ID = MAXNEWSTAT.ACT_OBJ_ID
    WHERE
    HRHISTORY.FLD_NBR=20
    and TO_DATE(HRHISTORY.DATE_STAMP)
        >= TO_DATE((TO_CHAR((ADD_MONTHS(SYSDATE,-1)),'YYYY/MM')||'/01'),'YYYY/MM/DD') 
        AND  TO_DATE(HRHISTORY.DATE_STAMP) <= (TO_DATE((TO_CHAR((ADD_MONTHS(SYSDATE,0)),'YYYY/MM')||'/01'),'YYYY/MM/DD'))-1
    PREVSTATID AS
    (SELECT
    /--Added by HAN--/
    HRHISTORY.COMPANY,
    HRHISTORY.EMPLOYEE,
    MAX(HRHISTORY.ACT_OBJ_ID)OBJ_ID
    FROM
    LAWSON.HRHISTORY
        INNER JOIN LAWSON.NEWSTAT
    /--Added by HAN--/
        ON HRHISTORY.COMPANY = NEWSTAT.COMPANY
        AND HRHISTORY.EMPLOYEE = NEWSTAT.EMPLOYEE
    WHERE
    HRHISTORY.FLD_NBR=20
    AND TO_DATE(HRHISTORY.BEG_DATE)
    < to_date(NEWSTAT.BEG_DATE)
    GROUP BY
    /--Added by HAN--/
    HRHISTORY.COMPANY,
    HRHISTORY.EMPLOYEE
    PREVSTAT AS
    (SELECT
    /--Added by HAN--/
    HRHISTORY.COMPANY,
    HRHISTORY.EMPLOYEE,
    HRHISTORY.A_VALUE A_VALUE,
    HRHISTORY.DATE_STAMP DATE_STAMP,
    HRHISTORY.BEG_DATE BEG_DATE,
    HRHISTORY.ACT_OBJ_ID OBJ_ID,
    HRHISTORY.SEQ_NBR SEQ_NBR
    FROM
    LAWSON.HRHISTORY
        INNER JOIN LAWSON.PREVSTATID
    /--Added by HAN--/
        ON HRHISTORY.COMPANY = PREVSTATID.COMPANY
        AND HRHISTORY.EMPLOYEE = PREVSTATID.EMPLOYEE
    WHERE
    HRHISTORY.FLD_NBR=20 AND
    HRHISTORY.ACT_OBJ_ID = PREVSTATID.OBJ_ID
    MAXPERSACTHST AS
    (SELECT
    PERSACTHST.EMPLOYEE,
    /--Added by KAM--/
    PERSACTHST.COMPANY,
    MAX(PERSACTHST.DATE_STAMP)DATE_STAMP
    FROM
    LAWSON.PERSACTHST
    WHERE
    (PERSACTHST.ACTION_CODE='LOASTATUS' OR PERSACTHST.ACTION_CODE='STATUS')
    AND TO_DATE(PERSACTHST.DATE_STAMP)
        >= TO_DATE((TO_CHAR((ADD_MONTHS(SYSDATE,-1)),'YYYY/MM')||'/01'),'YYYY/MM/DD') 
        AND  TO_DATE(PERSACTHST.DATE_STAMP) <= (TO_DATE((TO_CHAR((ADD_MONTHS(SYSDATE,0)),'YYYY/MM')||'/01'),'YYYY/MM/DD'))-1
    GROUP BY PERSACTHST.EMPLOYEE,
    /--Added by KAM--/
    PERSACTHST.COMPANY
    CHANGELIST AS   
    (SELECT
    PERSACTHST.EMPLOYEE,
    /--Added by KAM--/
    PERSACTHST.COMPANY,
    PERSACTHST.ACTION_CODE,
    PERSACTHST.REASON_01,
    PERSACTHST.DATE_STAMP,
    PERSACTHST.EFFECT_DATE,
    PERSACTHST.REASON_02,
    PREVSTAT.A_VALUE PS_A_VALUE,
    PREVSTAT.DATE_STAMP PS_HR_DATE_STAMP,
    PREVSTAT.BEG_DATE PS_HR_BEG_DATE,
    PREVSTAT.OBJ_ID PS_HR_OBJ_ID,
    PREVSTAT.SEQ_NBR PS_HR_SEQ_ID,
    NEWSTAT.A_VALUE NS_A_VALUE,
    NEWSTAT.DATE_STAMP NS_DATE_STAMP,
    NEWSTAT.BEG_DATE NS_BEG_DATE,
    NEWSTAT.NS_OBJ_ID,
    NEWSTAT.SEQ_NBR NS_SEQ_NBR
    FROM
    LAWSON.PERSACTHST PERSACTHST
                        INNER JOIN LAWSON.PREVSTAT
                       ON PERSACTHST.EMPLOYEE=PREVSTAT.EMPLOYEE
                       /--Added by KAM--/
                       AND PERSACTHST.COMPANY = PREVSTAT.COMPANY
                       INNER JOIN LAWSON.NEWSTAT
                       ON PERSACTHST.EMPLOYEE = NEWSTAT.EMPLOYEE
                      /--Added by KAM--/
                       AND PERSACTHST.COMPANY = NEWSTAT.COMPANY
                       INNER JOIN LAWSON.MAXPERSACTHST
                       ON PERSACTHST.EMPLOYEE = MAXPERSACTHST.EMPLOYEE
                      /--Added by KAM--/
                         AND PERSACTHST.COMPANY = MAXPERSACTHST.COMPANY
    WHERE
    (PERSACTHST.ACTION_CODE='LOASTATUS' OR PERSACTHST.ACTION_CODE='STATUS')
    AND NEWSTAT.A_VALUE <> PREVSTAT.A_VALUE
    AND MAXPERSACTHST.DATE_STAMP = PERSACTHST.DATE_STAMP
    PAEMPPOSENDDATE AS
    (SELECT
      PAEMPPOS.EMPLOYEE,
      PAEMPPOS.COMPANY,
      CASE
      WHEN PAEMPPOS.END_DATE = TO_DATE('1700,01,01','YYYY,MM,DD')
             THEN to_date(SYSDATE + 1,'YYYY,MM,DD')
           ELSE PAEMPPOS.END_DATE 
      END END_DATE,
      PAEMPPOS.EFFECT_DATE
      FROM LAWSON.PAEMPPOS),
    CURRFTE AS
    (SELECT
      PAEMPPOS.EMPLOYEE,
    /--Added by KAM--/
      PAEMPPOS.COMPANY,
      PAEMPPOS.FTE CURR_FTE,
      PAEMPPOS.EFFECT_DATE,
      PAEMPPOSENDDATE.END_DATE  
    FROM
    LAWSON.PAEMPPOS
    INNER JOIN LAWSON.NEWSTAT
    ON (PAEMPPOS.EMPLOYEE = NEWSTAT.EMPLOYEE)
    /--Added by KAM--/
    AND (PAEMPPOS.COMPANY = NEWSTAT.COMPANY)
    INNER JOIN LAWSON.PAEMPPOSENDDATE
    ON PAEMPPOS.EMPLOYEE = PAEMPPOSENDDATE.EMPLOYEE
    /--Added by KAM--/
    AND PAEMPPOS.COMPANY = PAEMPPOSENDDATE.COMPANY
    AND PAEMPPOS.EFFECT_DATE=PAEMPPOSENDDATE.EFFECT_DATE
    WHERE
      (PAEMPPOSENDDATE.EFFECT_DATE <= NEWSTAT.BEG_DATE AND PAEMPPOSENDDATE.END_DATE >= NEWSTAT.BEG_DATE)
    PREVFTE AS
    (SELECT
      PAEMPPOS.EMPLOYEE,
    /--Added by KAM--/
      PAEMPPOS.COMPANY,
      PAEMPPOS.FTE PREV_FTE,
    PAEMPPOSENDDATE.END_DATE 
    FROM
    LAWSON.PAEMPPOS
    INNER JOIN LAWSON.NEWSTAT
    ON (PAEMPPOS.EMPLOYEE = NEWSTAT.EMPLOYEE)
    /--Added by KAM--/
    AND (PAEMPPOS.COMPANY = NEWSTAT.EMPLOYEE)
    INNER JOIN LAWSON.PAEMPPOSENDDATE
    ON (PAEMPPOS.EMPLOYEE = PAEMPPOSENDDATE.EMPLOYEE)
    /--Added by KAM--/
    AND (PAEMPPOS.COMPANY = PAEMPPOSENDDATE.COMPANY)
    AND (PAEMPPOS.EFFECT_DATE = PAEMPPOSENDDATE.EFFECT_DATE)
    WHERE
      PAEMPPOS.EFFECT_DATE <= (NEWSTAT.BEG_DATE-1)AND  PAEMPPOSENDDATE.END_DATE >= (NEWSTAT.BEG_DATE -1)
    SELECT DISTINCT
    EMPLOYEE.EMPLOYEE,
    EMPLOYEE.DEPARTMENT,
    EMPLOYEE.PROCESS_LEVEL,
    EMPLOYEE.EMP_STATUS,
    EMPLOYEE.FIRST_NAME,
    EMPLOYEE.LAST_NAME,
    EMPLOYEE.MIDDLE_INIT,
    EMPLOYEE.POSITION,
    PAPOSITION.DESCRIPTION,
    CHANGELIST.PS_A_VALUE,
    /--Added by KAM--/
    CHANGELIST.COMPANY,
    CHANGELIST.PS_HR_DATE_STAMP,
    CHANGELIST.PS_HR_BEG_DATE,
    CHANGELIST.PS_HR_OBJ_ID,
    CHANGELIST.NS_A_VALUE,
    CHANGELIST.NS_DATE_STAMP,
    CHANGELIST.NS_OBJ_ID,
    CHANGELIST.ACTION_CODE,
    CHANGELIST.REASON_01,
    CHANGELIST.REASON_02,
    CHANGELIST.DATE_STAMP PERSACTSDATESTAMP,
    CHANGELIST.EFFECT_DATE PERSACTEFFDATE,
    DEPTCODE.R_NAME DEPTNAME,
    PRSYSTEM.R_NAME PLNAME,
    PREVFTE.PREV_FTE,
    CURRFTE.CURR_FTE,
    CHANGELIST.NS_BEG_DATE,
    PGSELECT.GROUP_NAME,
    PAEMPLOYEE.SENIOR_DATE
    FROM
    LAWSON.CHANGELIST
                      INNER JOIN LAWSON.EMPLOYEE
                     ON (EMPLOYEE.EMPLOYEE = CHANGELIST.EMPLOYEE)
    /--Added by KAM--/
                     AND (EMPLOYEE.COMPANY = CHANGELIST.COMPANY)
                     INNER JOIN LAWSON.DEPTCODE
                     ON ((EMPLOYEE.COMPANY=DEPTCODE.COMPANY)
                     AND (EMPLOYEE.PROCESS_LEVEL=DEPTCODE.PROCESS_LEVEL)
                     AND (EMPLOYEE.DEPARTMENT=DEPTCODE.DEPARTMENT))
                     INNER JOIN LAWSON.PRSYSTEM
                     ON ((EMPLOYEE.COMPANY=PRSYSTEM.COMPANY)
                     AND(EMPLOYEE.PROCESS_LEVEL=PRSYSTEM.PROCESS_LEVEL))
                     LEFT OUTER JOIN LAWSON.PREVFTE
                       ON (CHANGELIST.EMPLOYEE=PREVFTE.EMPLOYEE)
    /--Added by KAM--/                
                     AND (CHANGELIST.COMPANY=PREVFTE.COMPANY)
                     LEFT OUTER JOIN LAWSON.CURRFTE
                     ON (CHANGELIST.EMPLOYEE=CURRFTE.EMPLOYEE)
    /--Added by KAM--/                                
                     AND (CHANGELIST.COMPANY=CURRFTE.COMPANY)
                     INNER JOIN LAWSON.PGSELECT PGSELECT
                       ON ((EMPLOYEE.COMPANY=PGSELECT.COMPANY)
                     AND (EMPLOYEE.EMP_STATUS=PGSELECT.BEGIN_VALUE))
                     LEFT OUTER JOIN LAWSON.PAPOSITION
                     ON (EMPLOYEE.POSITION=PAPOSITION.POSITION)
                     AND (EMPLOYEE.COMPANY=PAPOSITION.COMPANY)
                     INNER JOIN LAWSON.PAEMPLOYEE
                     ON (CHANGELIST.EMPLOYEE=PAEMPLOYEE.EMPLOYEE)
    /--Added by KAM--/               
                    AND (CHANGELIST.COMPANY=PAEMPLOYEE.COMPANY)
    WHERE
    (PGSELECT.GROUP_NAME='G:ACTIVE' OR PGSELECT.GROUP_NAME='G:INACTIVE')
    >

    Hi Arsh,
    The error message you receive i.e.
    ORA-01830: date format picture ends before converting entire input string
    is an Oracle error.
    The following document would be helpful:
    ORA-01830:     date format picture ends before converting entire input string
    Cause:     A valid date format picture included extra data. The first part of the format picture was converted into a valid date, but the remaining data was not required.
    Action:     Check the specifications for date format pictures and correct the statement.
    Regards,
    Alpana

  • Change date format in dashboard promt and calendar

    hi,
    do any one know how to change the date format when using the calendar option in dashboard prompt. As the user picks a date from the calendar the format becomes DD-MM-YYYY. The customer would like YYYY-MM-DD!!
    Any suggestions?

    Hi Jose, i tried to update the settings in the NQSConfig.INI file, but there was no luck.
    I would like to mention my issue here again.
    I have a dashboard prompt built on a Date Column and I would like to see it as a Calendar Type. The value of this prompt is save in a variable pDate.
    In the answer, i have a filter on a date column(This is exactly the same column used to build the Prompt). The filter i set as Advance SQL Filter as I want to use the TimeStampAdd function.
    The filter is set as Date_Key = TimeStampAdd(SQL_TSI_DAY, -6, '@{pDate}')
    The above request when ran from the dashboard, gives me the following error:
    Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 17001] Oracle Error code: 932, message: ORA-00932: inconsistent datatypes: expected DATE got NUMBER at OCI call OCIStmtExecute. [nQSError: 17010] SQL statement preparation failed. (HY000)
    SQL Issued: SELECT Calendar."Time Id" saw_0, "Sales Facts"."Amount Sold" saw_1 FROM SH WHERE Calendar."Time Id" = TimeStampAdd(SQL_TSI_DAY, -6, '01/01/2002 12:00:00 AM') ORDER BY saw_0
    My understanding is that the Calendar control is populating pDate variable in 'mm/dd/yyyy hh:mi:ss' Format, while the TimeStampAdd function expect the variable as 'yyyy-mm-dd hh:ss:mi' Format.
    Is there any other place that we need to update on the server that will force the Calendar to return the prompt value in 'YYYY-MM-DD HH:MI:SS' Format ?
    Thanks
    Sai

  • Help by date format in UIX/XML

    In UIX/XML I would like to indicate the date fields in the format to 'DD.MM.YYYY '. I modify the properties of my view object and entity object in the window "structure window". It does not change view for anything.
    What wrong do I make?
    Who can help me please !!!!

    Please post what version of JDeveloper you are using. Also post a small sample application that shows what you are trying to do.
    I am not sure what you mean. Are you trying to display a date from the database, or have the user enter a date?
    The date format is determined from the client browser locale. It will default to the US date format mm/dd/yy unless the browser locale is overridden.
    If you want the user to enter a date, you should be using <dateField>. This will also expect mm/dd/yy unless you override it with a validater. Please refer to the UIX Element Reference. This documents <dateField>. The <onSubmitValidater> is a child of <dateField>, it is also documented in the Element Reference. <date> is the validater you want, it is a child of <onSubmitValidater>. You can specify a validation pattern.

  • Create unique Form ID - Help on Date Format in Concat

    I am having problems formating a date value in my concat statement.  I have tried to write is different ways and still can't seem to get the string correct.
    Ideally, I would like to change the date value to a Julian value for the form ID, but I would settle for just mmddyy value without the / or - in between.
    Codes I have tried w/out date format string
    JavaScript - Calculate
    Program.FormID.rawValue=Program.State.rawValue + Program.ProgramNumber.rawValue + Program.ProgramDate.formattedValue;
    Returns - MO1234Jul8,2010  
    -------------And--------------------
    Program.FormID.rawValue=Program.State.rawValue + Program.ProgramNumber.rawValue + Program.ProgramDate.rawValue;
    Returns - MO12342010-07-08
    FormCalc - Calculate 
    (This one has the current date as a value, but it changes the unique form ID when reopened on another day, that is why I am using ProgramDate)
    Concat(Date2Num(Date(), "ddmmyyy"),Program.State.rawValue, Program.ProgramNumber.rawValue)
    Returns - 0MO1234
    ----------- And --------------------
    if 
    (Program.ProgramNumber.rawValue ne null) then
    $.rawValue
    = CONCAT(Program.State.rawValue, Program.ProgramNumber.rawValue, Program.ProgramDate.formattedValue)
    else
    $.rawValue = ""
    endif 
    Returns - MO1234July8,2010  (formattedValue)
                  MO12342010-07-08 (rawValue)
    What would be the better  language to use, FormCalc or JavaScript for this example?
    I am not all that skilled at coding and use forums like this to help me, so I appreciate any help.
    Thanks in advance - Eve

    Date.prototype.yyyymmdd = function() {
       var yyyy = this.getFullYear().toString();
       var mm = (this.getMonth()+1).toString(); // getMonth() is zero-based
       var dd  = this.getDate().toString();
       return yyyy + (mm[1]?mm:"0"+mm[0]) + (dd[1]?dd:"0"+dd[0]); // padding
    Now, after having spliced the internal Date object, you can do this:
    d = new Date();
    d.yyyymmdd();
    The line above returns today's date: "20100709".

  • Help in date format for transaction F-01

    Hello Experts,
    I am currently modifying a report wherein it posts document using
    transaction F-01. Now, I am getting an error wherein it says:
    Direct input date: Date 04162007 is incorrect. The document has not
    been created.
    Now, how can I modify it in such a way that whatever format of the date is,
    it will be correctly translated to the proper format for F-01. For example,
    in my selection screen i enter it as 16.04.2007 and other users enter it as
    04/16/2007. Hope you can help me out here guys. Thank you and take care!

    Hai,
    You can enter any date format.
    But you have to validate the date format.
    The date format depends on the settings.
    The format code can be known by the <b>USR01</b> with <b>DATFM</b> field.
    So<b> select</b> that field value.
    <b>Depending</b> on that type(1 to 6)
    write your conversion code like:
    Case date_code.
      when 1.
         do convwersion here.  
      when 2.
    when 6.
         do convwersion here
    endcase.
    Hope now you can do with any date format.
    <b>Reward points if it helps you.</b>
    Regds,
    Rama chary.Pammi

  • Need help with date format mask

    Hi there, right now I'm trying to set a default date format mask constraint for one of the attributes for my table. I want to set the default mask constraint as MM/DD/YY but I don't know how to. it should be something like:
    CREATE TABLE work (WorkDate DATE CHECK (WorkDate = 'MM/DD/YY'))
    or something like that, but I don't think that's correct. Can anyone help me? Thanks in advance.

    What you want (and should have done) is to read the documentation, starting with the concepts:
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14220/datatype.htm#CNCPT413
    http://www.oracle.com/pls/db102/search?remark=quick_search&word=date&tab_id=&format=ranked
    A date is stored as, well, a date, format masks only come into play when you're selecting/retrieving a date or when you want to store a string as a date. Default date formats can be set through NLS_DATE_FORMAT at session and database level.
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14237/initparams122.htm#REFRN10119
    Documentation homes (from which you can do a simple quick search):
    http://www.oracle.com/pls/db102/homepage
    http://www.oracle.com/pls/db112/homepage
    Bottom line:
    Trying to set a default date format mask on a date datatype column makes no sense...

  • Helps on date format

    Hi all,
    I got the column in table A where the date format is dd/mm/yyyy ( 01/03/2005), and another table B where the date format is dd/mm/yyyy HH24:MI:SS. So in order to let the two table to talk to each other, I hv the following query
    B.transaction_date >= TO_DATE(A.start_date , 'DD-MON-RRRR HH24:MI:SS')
    B.transaction_date <= TO_DATE(A.end_date, 'DD-MON-RRRR HH24:MI:SS')
    I hv problem with the end result b'cos of the date format in table A is dd/mm/yyyy whereas the transaction_date in table B has the format with time. How can I format or convert the date in the table B to be in defaulted time such as A.start_date 00:00:00 and b.end_date 23:59:59 ??
    How to format this ? please helps. Thanks
    Rgds
    Lim

    Hello
    Are the transaction_date, start_date and end_date columns all DATE data types?
    If so, all DATE columns have the time component but it may be truncated i.e. set to 00:00:00. To do a date range in your case you could do something like:
         B.transaction_date >= A.start_date
    AND
         B.transaction_date < A.end_date + 1By using this construct you are forming a range between today at midnight and tonight at 23:59:59, so you don't have to worry about setting the time component on your end_date.
    HTH

  • Help with date format

    Hi, I have a record update form that shows Start date and End date in 2 separate fields like dd/mm/yyyy. When I edit the dates they do not get to the database correctly, all I get is 0000/00/00. I guess this is because the date format accepted by MySQL is yyyy/mm/dd.
    I'm stuck because I don't know how to convert the dates back to MySQL format for updating.
    This is the code that displays the start date:
    //<input name="AG_fechai" type="text" class="CP_loginFormFields" value="<?php echo date('d/m/Y',strtotime($row_eventosUpdate_RS['AG_fechai'])); ?>" size="32" />
    This is the code that displays the end date:
    //<input name="AG_fechaf" type="text" class="CP_loginFormFields" value="<?php echo date('d/m/Y',strtotime($row_eventosUpdate_RS['AG_fechaf'])); ?>" size="32" />
    This is my update query.(AG_fechai and AG_fechaf are the start and end date fields) which are not been updated. I appreciate your help. Thanks.
    // $updateSQL = sprintf("UPDATE t_agenda SET AG_fechai=%s, AG_fechaf=%s, AG_precio=%s, AG_horario=%s, AG_titulo_esp=%s, AG_titulo_eng=%s, AG_titulo_ger=%s, AG_titulo_fra=%s WHERE id_AG=%s",
    GetSQLValueString($_POST['AG_fechai'], "date",
    GetSQLValueString($_POST['AG_fechaf'], "date",
    GetSQLValueString($_POST['AG_precio'], "text",
    GetSQLValueString($_POST['AG_horario'], "text",
    GetSQLValueString($_POST['AG_titulo_esp'], "text",
    GetSQLValueString($_POST['AG_titulo_eng'], "text",
    GetSQLValueString($_POST['AG_titulo_ger'], "text",
    GetSQLValueString($_POST['AG_titulo_fra'], "text",
    GetSQLValueString($_POST['id_AG'], "int");
    mysql_select_db($database_amat_connect, $amat_connect);
    $Result1 = mysql_query($updateSQL, $amat_connect) or die(mysql_error());

    MySQL stores dates in one format only: the ISO recommended YYYY-MM-DD. You need to reorder the date parts to store the date correctly.
    If your input date is in the following format: dd/mm/yyyy, you can convert it by creating a custom function like this:
    function convertDate($val) {
      $parts = explode('/', $val);
      return "$parts[2]-$parts[1]-$parts[0]";
    Pass both dates to this function:
    GetSQLValueString(convertDate($_POST['AG_fechai']), "date",
    GetSQLValueString(convertDate($_POST['AG_fechaf']), "date",

  • Help with date formatting.

    Hi,
    I have been asked to fix a problem with a report. I have found that the problem is the date format being passed to the stored procedure is not correct, The current format is like Mon April 04 2007. The correct format should be DD-MMM-YYYY which I take to be Mon Apr 04 2004. I am not sure if this is correct anyway, but after looking at the code and the api I have managed to create a date object and call toString on it, after setting a simple date format to dd MMM yyyy.
    The problem is that the toString method returns Mon Apr 02 00:00:00 BST 20
    07. Is anybody able to help me with this? Below is a little bit of the code:
    public void renderDailyReport(ServletWriter out, HttpServletRequest request) throws Exception {
            // reset counters
            totalHits    = 0;
            maxHits      = 0;
            minHits      = 0;
            // get a GregorianCalendar object using the startDate and endDate Strings
            SimpleDateFormat  sdf         = new SimpleDateFormat("dd MMMM yyyy", Locale.UK);
            SimpleDateFormat procedureDateFormat = new SimpleDateFormat("dd MMM yyyy", Locale.UK);
            GregorianCalendar dateCounter = new GregorianCalendar();
            GregorianCalendar upperLimit  = new GregorianCalendar();
            sdf.setCalendar(Calendar.getInstance());
            Date sd = sdf.parse(startDate);
            Date ed = sdf.parse(endDate);
            procStartDate = procedureDateFormat.parse(startDate);
            procEndDate = procedureDateFormat.parse(endDate);The procStart and end dates are the bits that I added.
    They are passed to the stored procedure calling .toString, they are date objects.
    Appreciate any help.

    Do not use the toString() method of Date - it will always be the same format.
    Use the format() method of SimpleDateFormat.
    Date d = new Date();
    SimpleDateFormat sdf = new SimpleDateFormat("'dd-MMM-yyyy"); // or something like this
    String s = sdf.format(d);Message was edited by:
    jbish

  • Required help with date format

    Hi All,
    I am calling a webservice from plsql, for this I am using UTL_DBWS package. I want to insert the format of date as 'YYYY-MM-DD' only. I used to_char(sysdate, 'YYYY-MM-DD') , but it is throwing error. Please suggest any solution.
    Thanks and Regards,
    Mahesh
    The error details are as follows
    ORA-29532: Java call terminated by uncaught Java exception: javax.xml.rpc.soap.SOAPFaultException
    Caught exception while handling request: invalid date: 25-NOV-08
    ORA-06512: at "SYS.UTL_DBWS", line 403
    ORA-06512: at "SYS.UTL_DBWS", line 400

    user6391695 wrote:
    Hi All,
    I am calling a webservice from plsql, for this I am using UTL_DBWS package. I want to insert the format of date as 'YYYY-MM-DD' only. I used to_char(sysdate, 'YYYY-MM-DD') , but it is throwing error. Please suggest any solution.What happens is...
    You convert sysdate into a string of the format YYYY-MM-DD and then you are passing that to a parameter that is a DATE datatype. When you do this oracle has to implicitly conver the string to the DATE datatype. It does this based on the NLS settings of the session which, I would guess, are not of the format YYYY-MM-DD, so it can't understand the string you have passed and fails to convert it to a date.
    Date formats are not something that is stored on the database (assuming you are correctly storing dates as DATE datatype). The format of dates is a display issue and something that should be handled by the user interface. The database stores data, just that, no display formats. ;)

  • Help with date format and sql

    Hi
    I am a complete oracle idiot.
    I have created a table with 2 columns po_id,po_date. Yhe id data type is number,date type is date. To add values to the table i enter something like
    "insert into purchase_orders(po_id,po_date) values(1,01/01/2004)"
    It does not accept the date and will not add the record, i have also tried the date format 01-Jan-2004.
    What is the proper way to add the date.
    Thanks
    Garry

    You probably want to use an explicit to_date cast. That lets you specify the format of the date string, i.e.
    INSERT INTO purchase_orders( po_id, po_date )
      VALUES( 1, to_date( '01/01/2004', 'DD/MM/YYYY' );Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

Maybe you are looking for

  • How to configure purchase requistion in third party sale pls send me detail

    dear expert how to configure purchase requistion in third party sale pls send me details. waiting your valuable reply vicky

  • ITunes won't open, install or uninstall

    When I try running iTunes, i get the message: iTunes could not be installed because Visual Basic Script (Basic) is not installed or has been disabled. Make sure Basic is installed, turn off script blocking in anti-virus and personal firewall software

  • Flash Video

    I would like to know, what is the resource requirement for running a 20mb flash video. eg RAM, CPU, Video RAM. I have a system Via 1.3 processor, 1GB RAM, and 16 mb video ram (onboard) running flash 9 r115 on Linux kernel 2.6. Website: www.centeronet

  • Is it possible to access a group of (sequentia​l) registers with a single URL?

    I'm testing out datasockets to an A-B RSLinx OPC server. At the moment, it appears as though each register in the PLC has to be accessed with an individual URL. Is it possible to access a group of (sequential) registers with a single URL? I suspect i

  • Use of Zero (0) in Required Drop-Down List Field

    Using LiveCycle Designer ES 8.2.1x and Acrobat Pro Extended 9.1.2. I have a drop-down list (DDL) on a form for entering a quantity.  For certain reasons (i.e., quantity bundling/packages), I want to use a DDL. For one thing, if I set the default valu