How do I update just the day of a date value?

Example:
Table: FC_GQ_SOURCE_ANALYSIS
Sample_type = C
Effective_date = null
Sample_date = 20/13/07/14 09:00:00
What needs to happen is for any sample analysis that has a sample_type of "C" we need the effective date to be the first of the month for whatever month the sample date is and keep the time as it is…
so in the example data the effective date should be 2013/07/01 09:00:00.
How would I update just the day part of that date string?

Hi,
You don't need to convert to a string and back again to do that.  Use TRUNC to get the right day, and date arithmetic to get the right time, like this:
UPDATE  fc_gq_source_analysis
SET     effective_date = TRUNC (sample_date, 'MONTH')
                             + (sample_date - TRUNC (sample_date))
WHERE   sample_type  = 'C'
TRUNC (sample_date, 'MONTH')        is midnight on the 1st of the month that you want.
sample_date - TRUNC (sample_date)   is the time that you want, expressed as a number of days (e.g., 9/24 of a day).

Similar Messages

  • How do I pull just the year from a date?

    I'm trying to pull just the year from a date and cannot figure out how this can be done. I tried the SUBSTR fuction but its not acting how I would expect. What I'm wanting to do is write a condition that says Item Birth Year = Current Year minus 23 I have a calc that figures the age from the difference in the birthdate and current year but I'd really like to just write a condition based just one years. Can this be done?

    Hello
    SUBSTR will only work on a string. To extract portions of a date you need to use the TO_CHAR command.
    To get the year you would use this: TO_CHAR(the_date,'YYYY')
    TO_CHAR takes 2 switches, the date to be manipulated and the portion to be extracted, with the portion in single quotes.
    Once you get used to manipulating dates like this other common pieces are: DD - extracts the day of the month, MON extracts the 3 character code for the month.
    Thus you can use this: TO_CHAR(sysdate,'DD-MON-YYYY') and it will convert the current date, June 7th 2012 to 07-JUN-2012
    Hope this helps
    Best wishes
    Michael

  • How do I update to the most recent version of itunes?

    How do I update to the most recent version of Itunes?

    just hit the  logo in the menu bar (the menu bar is the bar wich is in the top of ur screen) then click "Software Update..." and check the where it says iTunes, then click Update. ur mac will restart and then iTunes will have the latest version (10.5.1)    
    George Karakadas, hope this will help u
    <Edited by Host>

  • How do I delete just the firefox bookmarks but not the the bookmarks toolbar icons

    I deleted my firefox bookmarks so I could import my gooogle bookmarks,but this also deleted my firefox bookmarks toolbar entries...it took me along time to put these in again.
    How do I delete just the firefox bookmarks but not the the bookmarks toolbar icons

    What kind of problems did you get after installing the extension?
    You can try to remove the history manually in the History Manager by doing a search for a colon.
    How many history items do you have to remove?
    If you only want to do this once or occasionally then you can consider to use this code:
    *http://kb.mozillazine.org/User:Dickvl/JavaScript_Error_Console#Expire_History_By_Days
    You will have to calculate the number of days that you want to keep to remove only history items from 2013 and older (365+31+28+26)
    You can open the Browser Console (Firefox/Tools > Web Developer).
    Paste the JavaScript code in the command line and press the Enter key to run the code.
    *Toggle the devtools.chrome.enabled pref on the <b>about:config</b> page to true to enable the command line
    *https://developer.mozilla.org/Tools/Browser_Console#Browser_Console_command_line
    <pre><nowiki>
    (function(){
    /* expire history by days, based upon bug 660646 comment 5/7 - [email protected] */
    var Cc = Components.classes, Ci = Components.interfaces;
    var his = Cc["@mozilla.org/browser/nav-history-service;1"].getService(Ci.nsIBrowserHistory);
    var prs = Cc["@mozilla.org/embedcomp/prompt-service;1"].getService(Ci.nsIPromptService);
    var day = 0, obj = new Object, txt = "Expire History"; obj.value = "90";
    if (prs.prompt(null,txt,"Days of history to keep",obj,null,{})){
    day = parseInt(obj.value);
    if(!isNaN(day)&&(day>0)){
    his.removeVisitsByTimeframe(0,(new Date().setHours(0,0,0,0) - day * 86400000) * 1000);
    }else{ prs.alert(null,txt,"Error Parsing Days: "+obj.value); }
    </nowiki></pre>
    If hat doesn't work then you may have a problem with the places.sqlite database file and you may have to reset places.sqlite.
    *Places Maintenance: https://addons.mozilla.org/firefox/addon/places-maintenance/
    You can move (copy/paste) history items that you want to keep to a bookmarks folder.
    See also:
    *Norwell History Tools: https://addons.mozilla.org/firefox/addon/norwell/

  • How can I get just the text to resize, rather than the entire web page?

    I used to be able to re-size just text on a webpage by typing Ctrl + +. Today, the entire webpage re-sizes, and when I move to another page it reverts. (I see this mostly in Facebook.). Why did this change, and can I go back to having just the text re-size?

    ''How can I get just the text to resize -- zoom text only''
    steps
    #"Alt" if no menu bar, then
    # View > Zoom > Zoom Text Only
    Zoom text of web pages - MozillaZine Knowledge Base
    :http://kb.mozillazine.org/Zoom_text_of_web_pages
    <br><small>Please mark "Solved" one answer that will best help others with a similar problem -- hope this was it.</small>

  • How do I print just the text in a power point opened in preview

    How do I print just the text in a power point opened in preview

    In the front panel, right click on the listbox object and select create>attribute node.
    In the diagram click on the attribute node and select "Item Names".
    Connect the desired array of string to the attribute node.
    BigBen

  • I downloaded pictures onto my iPhone from computer twice by mistake now when i uncheck/sync then check and sync again  i keep getting two lots of pics..how can i get just the one set again? thnx

    I downloaded pictures onto my iPhone from computer twice by mistake now when i uncheck/sync then check and sync again  i keep getting two lots of pics..how can i get just the one set again? thnx

    You're welcome.
    All photos transferred from your computer are stored in the iPhone's Photo Library regardless if you select a single album or folder of photos to be transferred or multiple albums or folders. The photos on the albums or folders of photos include a pointer to the original photos stored in the Photo Library. The photos are not duplicated taking up double the storage space. This way you can view the photos in an album or folder of photos only by selecting the album or folder, or all photos in all albums or folders by selecting Photo Library.
    Makes more sense when transferring multiple albums or folders of photos which cannot be changed when transferring only a single album or folder of photos.
    The same applies with iTunes and music playlists. A song can't be in a playlist unless it is in the main iTunes library. Placing a song in a playlist does not duplicate the song.

  • I imported an hour of video into iMovie HD and cut it down to a 33 sec clip, and emptied the trash.  When I save the project, the file size is 20Gb.  How can I save just the 33 sec clip?

    I imported an hour of video into iMovie HD and cut it down to a 33 sec clip, and emptied the trash.  When I save the project, the file size is 20Gb.  How can I save just the 33 sec clip?

    Non-destructive editing is an important feature of iMovie HD 6.
    iMovie preserves the entire copy of every clip you place into your movie in case you change your mind at a later stage.
    So, if you have cut out one minute from a 45 minute clip, iMovie will have stored two complete copies of that clip. This is why is helps to set import as 3-5 minute clips rather than one huge chunk. As DV runs at 13GB per hour your project files can get very big.
    One workaround is to complete the editing of a section of the movie, then export that to Quicktime: highlight the clip/s, choose Share-Quicktime, turn on Share selected clips only, and choose Full Quality from the pop-ip menu.
    Once you have saved the stand-alone clip to your hard drive, you can re-import it into your project using the File/Import command, and delete the original long clip/s from the project.

  • I still have ilife '09. How can i update to the new ilife? Do i have to pay for each app seperately in order to update?

    I still have ilife '09. How can i update to the new ilife? Do i have to pay for each app seperately in order to update?
    I am an Aperture user and I am tired of managing my old iphoto library seperately. In order to use the new combined aperture/iphoto abilities i need a newer version of iphoto. Apple says that the new iphoto is free, however my iphoto (version 8.1.2) did not update. How do i update iphoto so that i can use the library with Aperture?

    iPhoto, iMovie and Garageband are free. However, you must be running Mavericks in order to download and use them. Mavericks is free also.  Therefore your Mac must be capable of running Mavericks:
    The following is from: Apple - Upgrade your Mac to OS X Mavericks.
    iMac (Mid 2007 or newer)
    MacBook (Late 2008 Aluminum, or Early 2009 or newer)
    MacBook Pro (Mid/Late 2007 or newer)
    MacBook Air (Late 2008 or newer)
    Mac mini (Early 2009 or newer)
    Mac Pro (Early 2008 or newer)
    Xserve (Early 2009)
    iWork is not as it's an upgrade and not an update. Upgrades for iWork have always had to be purchased. However, the previous iWork apps will work fine with Mavericks.
    OT

  • If I put an item in clippings that I reduced from a larger article, how do I print just the clippings excerpt?

    If I put an item in clippings that I reduced from a larger article, how do I print just the seperate clippings excerpt?

    Hi Mark,
    I think one thing you may missing is an understanding of the purpose and operation of the mail merge process.
    Mail merge is used to 'personalize' a preset document using information from the records of a database. Any content that will vary from copy to copy of the document must be imported from the database. Every item that is specific to the copy being sent to a specific individual must be included in the row of the table containing the record for that individual.
    For invoices, unless you are sending an invoice for the same item(s) at the same price(s), you'll need to either include the items and prices in the database and merge them into the invoices, or use the merge document to create a document containing an empty invoice for each customer, containing only the customer identification information, and the company information (taken from the card marked "My Card" or "Me"), then fill in each invoice manually.
    The Pages '09 template named "Invoice" might word with the second approach, depending what type of document the merge to file option produces. If it's a Pages document, the table, containing the invoice data, will likely be useable; if it's a pdf document, the table may be editable (or not), but will lose its ability to calculate the tax amounts and totals.
    To produce an individual invoice from this template:
    Open the template.
    Drag the recipient's card from Contacts/Address Book and drop it on one of the fields in the first block of address text.
    Enter the project information in the second block of text.
    Check the Company block in the left margin for correctness.
    Enter the Invoice items and quantities in the table.
    Print (or Print to PDF) the document and mail it.
    Regards,
    Barry

  • My new I5 uploaded doubleded all the songs from my library! Please, can somebody help me showing how can I delete just the songs that was doubled?

    Hi there everybody,
    My new Iphone 5 uploaded doubleded all the songs from my library! Please, can somebody help me showing how can I delete just the songs that was doubled?
    Some help will be greatly appreciate.
    Thanks much!

    When you say "account," do you mean your iTunes library, because your iTunes library is what is on your computer?  Your iTunes library does not have an email address.  An account that is related to iTunes is your Apple ID (which is an email address) and you use it as your user name to sign in to the iTunes Store, to make purchases.  Changing your Apple ID will not make songs disappear from your computer's iTunes library.
    If you had an Apple ID and used it to make song purchases from the iTunes Store, and then started using a different Apple ID, you should be able to re-download the songs purchased with the old Apple ID.  In iTunes, sign in to the iTunes Store using your OLD Apple ID (and password).  That may not be your current email address, but Apple uses it as your user name, so it does not matter.
    On the iTunes Store Home screen, click on Purchased under QUICK LINKS.  This takes you do the Purchased screen, where you can re-download previous song purchases (for that Apple ID) at no cost. 
    NOTE:  If those song purchases are from more than a few years ago, you may also need to authorize your computer to play (and sync) songs for your old Apple ID. 
    For songs that were not purchased from the iTunes Store, if they are also gone, you cannot get them back unless you have a backup (or they are still loaded on your old iPod).
    If that's not what you mean by "changed the email address on my account," please post back with more details.

  • How do I move just the Video to the timeline in Premiere cs6, not the audio?

    how do I move Just the Video to  the timeline in Premiere, not the audio?

    Hi there! I'd try posting this over in the official Premiere Pro forum: http://forums.adobe.com/community/premiere/premierepro_current?view=overview
    The Premiere experts over there are more likely to help you out with your problem

  • HT2188 How can I update to the latest ios version on my ipod touch?

    How can I update to the latest ios version on my ipod touch?

    Check to see what model of iPod you have:
    http://support.apple.com/kb/HT1353
    If you have a second-generation iPod, the last version of iOS it can run is iOS 4.2.1. If you have a 3rd or 4th generation iPod touch, see:
    http://support.apple.com/kb/HT4972
    Regards.

  • How do I update to the latest version on InDesign?

    How do I update to the latest version on InDesign?

    If you mean how do you update the version you have you can try going thru the Help option in the main toolbar or you can try direct updates.
    Direct Updates
    https://www.adobe.com/downloads/updates/
    cc updates:  http://prodesigntools.com/adobe-cc-updates-direct-links-windows.html
    cc 2104 updates:  http://prodesigntools.com/adobe-cc-2014-updates-links-windows.html
    If you mean how do you upgrade to the latest version then you purchase a Cloud subscription for InDesign or for the Complete plan.
    Creative Cloud Plans
    https://creative.adobe.com/plans

  • HT4623 how do I update to the latest ios? i have a ipad 1.

    How do I update to the lastest ios?I have a ipad 1

    Did you read the instructions in the article?
    Update your device using iTunes
    Ensure that you're using the latest version of iTunes.
    Connect your device to your computer using the included USB cable.
    After iTunes opens, select your device when it appears in iTunes under Devices.
    Click "Check for Update" in the Summary pane to check for available updates.

Maybe you are looking for