Remove or Change seconds in Date field

Hello All,
I have a field which is storing the start and end time. data type is date ( oracle 8.1.6). while the data is store into the table it is taking seconds also, but the requirement is to store only hours and minutes not seconds. for eg. if the time is '30/10/2007 10:30:59'. How to do this. ?
regards
Kris

but the requirement is to store only hours and minutes not secondsThis doesn't sound like a requirement for storing the data but rather for retrieving or displaying the data. While yo can store the date with '00' seconds it might be more flexible to store the data with seconds and convert it later when you retrieve the data. Either way you can use one of the following;
SQL> create table t as (
   select to_date('30/10/2007 10:30:59', 'DD/MM/YYYY HH:MI:SS') col1 from dual)
Table created.
SQL> select to_char(col1, 'DD/MM/YYYY HH:MI') || ':00' new_date
from t
NEW_DATE          
30/10/2007 10:30:00
1 row selected.
SQL> select trunc(col1, 'MI') new_date
from t
NEW_DATE          
30/10/2007 10:30:00
1 row selected.

Similar Messages

  • Tax Code removed on changing the posting Date in Purchase Order

    Dear All,
    This is with reference to the Purchase Order Document tax part, the document has been defined with the approval procedure and document series followed as annual series. The document series is linked to the period indicator as I am using the monthly series for the A/R & A/P Invoice.
    Now some Purchase Order was generated in the last month i.e. 30 NOV 07 which has gone for approval. These document are approved in the current month (Dec 07) & user are trying to add the records it displays the message as "Date deviates from permissible range [Purchase Order - Posting Date]  [Message 173-11]" as the period indicator is changed to Dec 07 in document numbering.
    The problem is when user changes the document date to Dec 07 for posting; system removes the tax codes, which is available in the document. Now as this is approved document user is not able to change or renter the tax codes.
    In this situation what can be done as the same case will again happen for the next month.
    Pls. provide the solution / work around for this problem.
    Regards,
    Yogesh Jadav

    hi yogesh,
    Cancel/Close the created purchase order.
    First you should change docduedate in posting period upto december 2007/end of fiscal year,by following the below path.
    (Administration->sytem intialization-> general settings--> posting period tab)
    Create a new purchase order.
    Send it for approval,authorizer can change date as required,
    once the posting date changes,tax code get refreshed,authorizer
    need to select tax code once again.
    <b>Tax code normally get refreshed when you change posting date it's normal
    system behaviour.</b>
    After authorizer does above changes,he can approve purchase order.
    Once purchase order is approved,orginator can add it as purchase order in draft stauts.
    <b>After approval we can not do any changes in purchase order.</b>
    Hope my solution will solve the problem.
    Thanks,
    With regards,
    A.Jeyakanthan

  • Business partner change Valid From Date field

    How can I change the Valid From Date field in tables:
    BUT000
    BUT020
    BUT0BK
    BUT100
    Currently the of date of creation of the business partner is in this tables' Valid From field.
    In transaction BP the Address of the Business Partner is  valid from 01.01.1990 but still I get a warning that the business partner is not valid for date 01.11.2011.

    Sounds like the problem is the valid to date.  What is that date set to?

  • Add  5 second in date field

    I have table emp(a number, b date )
    I want to add in date field to 5 second only
    plz suggest me

    double post
    Re: Query to add in date field to second

  • Removing characters from an input data-field

    Hi.
    Is it possible to "Trim Off" characters from a Text Field data, and automatically input them into another Text field?
    Let's say I have the following code :
    *<Field name='telephonenumber'>*
    *<Display class='Text'>*
    *<Property name='title' value='Phone Number in International Format'/>*
    *<Display>*
    *</Field>*
    This code is to input the telephone number in International Format (such as :  +1 234 567 8900)
    Now, lets say that I want to create a second Data Text field for phone number; but, this time, it is for the phone number in LOCAL format.
    In other words, I want to write a code which will AUTOMATICALLY  remove the first 3 or 4 characters from the "International Number",  and input them into the "Local Number"  field.
    This would save me the trouble or writing the number a second time. My code should be able to simply Trim Off the initial "+1 234", and automatically input the remaining "*567 8900"* into the Local Number field.
    How could I accomplish this?
    Thanks

    Based on your code, it looks like you have fields called global.workgsmad (local style) and global.workgsm (international style)
    Assuming your global.workgsm format will always be '+x xxx xxx xxxx' you want to skip the first 6 characters, not 4
    The simplest way to do this is like so:
    <Field name='global.workgsmad'>
       <Expansion>
          <substr>
             <ref>global.workgsm</ref>
             <i>6</i>     <!-- Skip the country code and area code '+x xxx ' -->
             <i>8</i>   <!-- 8 characters were left for the format 'xxx xxxx' -->
          </substr>
       </Expansion>
    </Field>Alternatively, you could change the substr block to read
    <substr s='6' l='8'>
       <ref>global.workgsm</ref>
    </substr>Both formats are valid.
    If the phone number is not a fixed format, you'll have to do something more complicated.
    Jason

  • How to change crystal report data field at runtime ?

    Hello everyone,
    I have a Crystal Report file ,which i am using to generate report for my windows form project .
    In that report i have a filed called as Quantity which data type is set as decimal, the requirement is like that the number of value those comes after decimal point that should be set according to the value which is given by the user at the run time .
    For eg: If user gives 1 at the run time then the report Qty field value set one value after decimal point. Like 12.1
    if user gives 2 then Qty field the value is 12.22 like tat  but user can give from zero to any number.. and if it is zero it should not show decimal
    Note: The main idea hear is how to change the filed in Crystal Report decimal point value by using code(or we say writing code we need to set manually as user input it will change)
    Can any body help me how to solve this issue .
    S.K Nayak

    I think you could probably make the field you see a formula field and take a parameter as the number of decimal places.
    totext converts a number to a string.
    totext({decimalField}, 2)
    That's 2 decimal places.
    You could probably substitute a {parameter} for that 2.
    If not then you could substitute an entire formula.
    To explore formulas:
    foreach (FormulaFieldDefinition f in rpt.DataDefinition.FormulaFields)
    MessageBox.Show(f.Name);
    // f.Text = your new formula
    Where rpt is an instantiated report.
    Or add another string field which you display in the column and do the calculation with the original decimal.
    Hope that helps.
    Recent Technet articles:
    Property List Editing;  
    Dynamic XAML

  • Color Changes in Spry Data Fields

    Hi All,
    I'm new to Javascript & PHP  programming. Currently I have coded neccesary apperances for the Web  Page and also Spry Data Set to read an external XML date source file.
    What I need  to do is one of the fields, needs to have color based status changes  based on certain data or criterias received.
    For example,
    I have a  Spry Table displayed on my browser,
    Name
    Current  Status
    Lane
    Jane
    6  Mins
    1
    Peter
    Boarding
    2
    Sally
    Arriving
    3
    Alex
    Delayed
    4
    With the  above, what I need is when the current status show in minutes, the text  color will be white (This has been coded with CSS Style)
    For the  Current Status color changes, when I received anything apart from  minutes, the display will be as of below :-
    Minutes = Black
    Boarding  = Red
    Arriving = Green
    Delayed = Yellow
    My question  is can this be coded with just Javascript, HTML and normal CSS
    OR
    This  needs to be coded in PHP, ASP ?
    I'm not familiar with ASP and only have very  little knowledge of PHP. If anyone here have some experience with this,  can offer some advice on how I can apply this theory into my existing.  And if possible some code example would be great.
    Thanks.

    I have tried many times on Ben's method and it didn't work.
    I have also tried the method from Adobe's documentation site.
    Method 1
    <ul spry:region="dsStates" spry:if="{ds_RowCount} != 0" spry:repeat="dsStates" spry:test="'{name}'.match(/^[amn]/i);" spry:choose="choose">
         <li spry:when="'{name}'.match(/^n/i);" style="color: red;">{name}</li>
         <li spry:when="'{name}'.match(/^m/i);" style="color: blue;">{name}</li>
         <li spry:when="'{name}'.match(/^a/i);" style="color: green;">{name}</li>
    </ul>
    Method 2
    <div spry:region="dsStates" spry:if="{ds_RowCount} != 0">
    <table border="1" spry:repeatchildren="dsStates" spry:test="'{name}'.match(/^[amn]/i);" spry:choose="choose">
         <tr spry:when="'{name}'.match(/^n/i);" style="background-color: red;"><td>{name}</td></tr>
         <tr spry:when="'{name}'.match(/^m/i);" style="background-color: blue;"><td>{name}</td></tr>
         <tr spry:when="'{name}'.match(/^a/i);" style="background-color: green;"><td>{name}</td></tr>
    </table>
    </div>
    Can anyone make it plain and simple of how the data source should look like ?
    I'm posting my source code here to make things easy.
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xmlns:spry="http://ns.adobe.com/spry">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    <script src="SpryAssets/xpath.js" type="text/javascript"></script>
    <script src="SpryAssets/SpryData.js" type="text/javascript"></script>
    <script type="text/javascript">
    var KomtarETA = new Spry.Data.XMLDataSet("KomtarETA.xml", "komtareta/bus", {useCache: false, loadInterval: 100});
    </script>
    </head>
    <body>
    <div spry:region="KomtarETA">
      <table>
        <tr>
          <th>Route</th>
          <th>Current</th>
          <th>Destination</th>
          <th>Next</th>
          <th>Lane</th>
        </tr>
        <tr spry:repeat="KomtarETA">
          <td>{route}</td>
          <td>{current}</td>
          <td>{destination}</td>
          <td>{next}</td>
          <td>{lane}</td>
        </tr>
      </table>
    </div>
    </body>
    </html>
    The above is the HTML file I start working with.
    The {Current} field needs to have it's data periodically changing color & addition of flashing effect based on it's input from the XML data.
    So my question is how do I work about ? I don't quite get the explanation above.
    Thanks.

  • Change of due date field in F-36 t.code

    Hi
    I posted Bills of exchange transaction thru F-36 t.code. Due on will be the future maturity date of Bill. While entering user made mistake. Now i want to change the date. I tried with Fb02 but it is grayed.
    Pls suggest me.
    Thanks
    Sneha

    Hello,
    Check the document change rules in OB32.
    I believe you are referring the following field.
    BKPF-XWVOF
    If yes, then
    OB32,
    Give account type, transaction type, company code.
    Tick field can be changed.
    Save.
    Regards,
    Ravi

  • Print a new report whenever a change occurs to data field

    Post Author: goffj1
    CA Forum: General Feedback
    Please forgive my ignorance but this is my first experience with CR. 
    I have a dynamic dataset with multiple records.  Each records contains a TASK number that groups all the records relating to that TASK.
    Can I force a sperate printed report for each TASK number?
    I can do this with other reporting tools using group headers and such but so far how to do this in CR has eluded me.

    Post Author: pandabear
    CA Forum: General Feedback
    Goffj1,
    I'm not 100% sure I understand what you want, but this is what I think you want:
    Go to Reports/Group Expert
    Select the field "Task Number".
    Go to the Section Expert for the "Task Number" group you just created,
    and select "New Page After".
    This will separate each "Task Number" group by a page when you print.
    Under the "Task Number" group on the report, you can now add
    more groups or add more fields to the Details line as needed.
    Hope this helps,
    The PandaBear

  • How to removed leading zeros from a date field.

    CONVERT(NVARCHAR, CONVERT(DATETIME, CONVERT(CHAR(8), STM.CreationDate)), 101)
    This is what i currently have, but prints 02/03/2014 i would like to print the date without the zeros when applicable.
    Thanks in advance.

    >>REPLACE(LTRIM(REPLACE(CONVERT(NVARCHAR, CONVERT(DATETIME, CONVERT(CHAR(8), STM.CreationDate)), 101),'0', ' ')), ' ', '0')
    Does this query really works? I doubt
    Satheesh
    My Blog |
    How to ask questions in technical forum

  • Issue with fetching records when SalesForce Date Fields involved

    Using the Events application of Salesforce I enter a record of data.  The record has a Start Date of Monday and an End Date of Friday for a given week.  Crystal will not fetch/display the record in the report.  If I go back and change the Start Date and the end Date to teh same day, the record will print in Crystal.
    Is there some Date flag within Crystal that I need to toggle allowing a record to print based on date ranges?  I don't understand why a record would print when Start and End Date are the same but will not print when different?

    Here is the code....  I have also noticed that there are three fields - Start Date, End Date and Due Date.  Only when all 3 fields are set to the same value within Salesforce will the record print in Crystal.  I have tried removing any reference to the Date fields in the crystal report but its not helping
    www.salesforce.com
    SELECT Name, Id
    FROM   Account
    EXTERNAL JOIN Account.Id={?www.salesforce.com: Event.AccountId}
    www.salesforce.com
    SELECT ActivityDate, CAT_Type__c, Subject, Location, PO_Number__c, CO_Number__c, Is_Closed__c, Description, Submit_For_Invoice__c, Is_Scheduled__c, Status__c, RecurrenceStartDateTime, RecurrenceEndDateOnly, OwnerId, AccountId
    FROM   Event
    WHERE  (CAT_Type__c='Remote Support - Non Revenue' OR CAT_Type__c='Remote Support - Revenue' OR CAT_Type__c='Travel - Non Revenue' OR CAT_Type__c='Travel - Revenue') AND (Status__c='Closed' OR Status__c='Complete - Not Closed' OR Status__c='Open')
    EXTERNAL JOIN Event.AccountId={?www.salesforce.com: Account.Id} AND Event.OwnerId={?www.salesforce.com: User.Id}
    www.salesforce.com
    SELECT LastName, Id
    FROM   User
    EXTERNAL JOIN User.Id={?www.salesforce.com: Event.OwnerId}

  • Using a date field to remove 'duplicates'

    Hi all,
    Really struggling here, would appreciate some fresh ideas !!
    I have a ton of rows in a table that are duplicates with the exception of a date field that differs very slightly.
    e.g.
    TO_CHAR(START_DATE,'
    13-JUN-2007 12:39:03
    13-JUN-2007 12:39:10 << dup
    18-JUN-2007 05:49:15
    18-JUN-2007 05:49:21 << dup
    13-JUN-2007 09:02:25
    13-JUN-2007 09:02:32 << dup
    It would be great if I could identify these dups in SQL and remove them. I've sampled the data and the times are out by between 5 and 7 seconds so if I could weed out all rows that have another row with a time that differs by <10 seconds that would be ideal.
    My other, but not as thorough, idea was to drop the seconds and I would be then able to drop them as if they were true duplicates ... run the risk of not catching some that way though.
    Any ideas?
    Many thanks in advance!
    Adam

    Assuming that you could legititmately have two records for the same day that are more then 10 seconds apart (and you would not consider these to be duplicates, then something along these lines should do it. In the initial select, I have bolded the "duplicates"
    pre]SQL> SELECT * FROM rt;
    SNO SDATE
    1 13-jun-2007 12:39:03
    1 13-jun-2007 12:39:10
    1 13-jun-2007 12:39:12
    1 13-jun-2007 12:39:45
    2 18-jun-2007 05:49:15
    2 18-jun-2007 05:49:21
    3 13-jun-2007 09:02:25
    3 13-jun-2007 09:02:32
    SQL> DELETE FROM rt
    2 WHERE rowid IN (SELECT rid
    3 FROM (SELECT sno, sdate, rowid rid,
    4 LAG(sdate) OVER (PARTITION BY sno
    5 ORDER BY sdate) rn
    6 FROM rt)
    7 WHERE (sdate - NVL(rn, sdate))*24*60*60 BETWEEN 1 and 10);
    4 rows deleted.
    SQL> SELECT * FROM rt;
    SNO SDATE
    1 13-jun-2007 12:39:03
    1 13-jun-2007 12:39:45
    2 18-jun-2007 05:49:15
    3 13-jun-2007 09:02:25
    This keeps the oldest of the duplicates by sdate, if you want to keep the newest, then something like:
    SQL> rollback;
    Rollback complete.
    SQL> DELETE FROM rt
      2  WHERE rowid IN (SELECT rid
      3                  FROM (SELECT sno, sdate, rowid rid,
      4                               LEAD(sdate) OVER (PARTITION BY sno
      5                                                ORDER BY sdate) rn
      6                        FROM rt)
      7                  WHERE (NVL(rn, sdate) - sdate)*24*60*60 BETWEEN 1 and 10);
    4 rows deleted.
    SQL> SELECT * FROM rt;
           SNO SDATE
             1 13-jun-2007 12:39:12
             1 13-jun-2007 12:39:45
             2 18-jun-2007 05:49:21
             3 13-jun-2007 09:02:32John

  • Working days between two date fields and Changing Factory Calendar

    Hi,
    I have to calculate working days between two date fields excluding the weekends and public holidays for Switzerland.
    I have written the routine using factory calender and its working fine except for two problems now:
    1. If any one of the date field is empty then teh rsult should be zero.
    2. And the below code is working from 1996 but my cleints wants it to work for years before 1996 as well.
    I also tried to change the Start date in SCAL for factory calendar but it says enter values between 1995 to 2020.
    I am new to ABAP. Please help me how i can achieve these for below code.
    DATA: IT_HOLIDAYS type TABLE OF ISCAL_DAY,
          IS_HOLIDAYS TYPE ISCAL_DAY.
    DATA: T_DATE TYPE SY-DATUM,
          P_DATE TYPE SY-DATUM.
    DATA : X_DATE(4) TYPE C.
    DATA: CNT TYPE I.
    REFRESH : IT_HOLIDAYS.
    CLEAR : IT_HOLIDAYS.
    T_DATE = SOURCE_FIELDS-/BIC/ZCCCHP812.
    P_DATE = SOURCE_FIELDS-/BIC/ZCCCHP810.
    CALL FUNCTION 'HOLIDAY_GET'
    EXPORTING
    HOLIDAY_CALENDAR = 'CH'
    FACTORY_CALENDAR = 'CH'
    DATE_FROM = P_DATE
    DATE_TO   = T_DATE
    TABLES
    HOLIDAYS = IT_HOLIDAYS
    EXCEPTIONS
    FACTORY_CALENDAR_NOT_FOUND = 1
    HOLIDAY_CALENDAR_NOT_FOUND = 2
    DATE_HAS_INVALID_FORMAT = 3
    DATE_INCONSISTENCY = 4
    OTHERS = 5.
    DESCRIBE TABLE IT_HOLIDAYS LINES CNT.
    X_DATE = T_DATE - P_DATE - CNT.
    RESULT = X_DATE.
    Please help
    Regards
    Zabina
    Edited by: Syed786 on Nov 2, 2011 9:15 AM

    Hi Zabina,
    Try this function module  'DURATION_DETERMINE'.
    Give the factory calendar and unit as DAY
    With regards,
    Rajesh

  • How can I remove dropdown calendar menu from date/time field.

    I set up a javascript calculation based on the input of a date field. As long as the user enters the date manually the script works fine. If user attempts to select date by drop down menu then script will not work. How can I remove the calendar feature from the Date field?

    You may have to wire custom script to get you what you need. That would probably work on 'exit' event.
    Just you give you better Idea here is some thing I have on a date field. If user types his own date instead of picking from calendar this code checks whether it is valid date or not and returns to the same field either they enter valid date or clear the field.
    This is FormCalc script. You may get the idea how this works and make it work for you using the same logic either in FormCalc or JavaScript.
    ----- form1.SOF.Head.Table1.Row1.ReqDate.Date_ReqDate::exit: - (FormCalc, client) ------------------
    if (HasValue($)) then
    if (Len($.rawValue) == 10) then
    var S1
    var MM
    var DD
    var YYYY
    var Derror
    var D1
    var D2
    var S2
    Derror = 0
    D1 = 0
    D2 = 0
    S1 = $.rawValue
    D1 = At(S1, "-")
    S2 = Right(S1, 5)
    D2 = At(S2, "-")
    if (D1 > 0 and D2 > 0) then
    if (D1 == 3 and D2 == 1) then
    MM = Substr(S1, 1, 2)
    DD = Substr(S1, 4, 2)
    YYYY = Substr(S1, 7, 4)
    elseif (D1 == 5 and D2 == 3) then
    MM = Substr(S1, 6, 2)
    DD = Substr(S1, 9, 2)
    YYYY = Substr(S1, 1, 4)
    else
    Derror = Derror + 1
    endif
    else
    Derror = Derror + 1
    endif
    if (Oneof(MM, "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12")) then
    Derror = Derror
    else
    Derror = Derror +1
    endif
    //xfa.host.messageBox("MM"+ Derror, "Incorrect Date", 1, 0)
    if ((Oneof(DD, "01", "02", "03", "04", "05", "06", "07", "08", "09")) or ((DD >=10) and (DD <= 31))) then
    Derror = Derror
    else
    Derror = Derror + 1
    endif
    //xfa.host.messageBox("DD"+ Derror, "Incorrect Date", 1, 0)
    if ((YYYY >= 1975) and (YYYY <= 2050)) then
    Derror = Derror
    else
    Derror = Derror + 1
    endif
    //xfa.host.messageBox("YYYY"+ Derror, "Incorrect Date", 1, 0)
    if (Derror > 0) then
    xfa.host.messageBox("Preferred valied date between Jan 01, 1975 and Dec 31, 2050. ", "Incorrect Date", 1, 0)
    xfa.host.setFocus($.somExpression)
    else
    //good
    $.formattedValue = Format("MMM DD, YYYY", Concat(YYYY, MM, DD))
    if ($event.shift) then
    //xfa.host.messageBox("Shift")
    var sh
    sh = 1
    //xfa.host.setFocus("xfa.form.form1.SOF.Head.RadioAttachTo.RadioAttachTo3")
    else
    if (xfa.event.commitKey == 1) then
    var A
    A = 1
    else
    xfa.host.setFocus("xfa.form.form1.SOF.Head.Table1.Row2.CustName")
    endif
    endif
    endif
    else
    xfa.host.messageBox("Preferred valied date in format MMM DD, YYYY.", "Incorrect Format", 1, 0)
    xfa.host.setFocus($.somExpression)
    endif
    endif
    Good luck,
    SekharN

  • Date field input help - changing first day of the week

    Hi,
    I need to change the starting day of the week  in a date field value help. I also need to change the days name in this calender.
    Thanks in Advance,
    Dekel.

    I found how to change the first day of the week, through BAdi calendar_definition.
    Can anyone help me locate the day names? (I checked - FM day_names_get dosen't get the names of the UI search help).
    Thanks,
    Dekel.
    Edited by: dekel31 on May 29, 2011 1:17 PM

Maybe you are looking for