Create a timestamp with current_timestamp but keeping the seconds as 00

Hi Everyone,
I was wondering if there is an easier/better way to use the current_timestamp as my base timestamp and display another timestamp with current time and the seconds as 00. E.g., 4:30:00. The below is working but I am thinking it is overly complex.
CAST('timestamp' || ' ' || char(39) || TRIM(CAST(YEAR(CURRENT_DATE) AS CHAR)) || '-' ||
CASE WHEN MONTH(CURRENT_DATE) = '1' THEN '01'
WHEN MONTH(CURRENT_DATE) = '2' THEN '02'
WHEN MONTH(CURRENT_DATE) = '3' THEN '03'
WHEN MONTH(CURRENT_DATE) = '4' THEN '04'
WHEN MONTH(CURRENT_DATE) = '5' THEN '05'
WHEN MONTH(CURRENT_DATE) = '6' THEN '06'
WHEN MONTH(CURRENT_DATE) = '7' THEN '07'
WHEN MONTH(CURRENT_DATE) = '8' THEN '08'
WHEN MONTH(CURRENT_DATE) = '9' THEN '09'
ELSE CAST(MONTH(CURRENT_DATE) AS CHAR) END || '-' ||
CASE WHEN DAYOFMONTH(CURRENT_DATE) = '1' THEN '01'
WHEN DAYOFMONTH(CURRENT_DATE) = '2' THEN '02'
WHEN DAYOFMONTH(CURRENT_DATE) = '3' THEN '03'
WHEN DAYOFMONTH(CURRENT_DATE) = '4' THEN '04'
WHEN DAYOFMONTH(CURRENT_DATE) = '5' THEN '05'
WHEN DAYOFMONTH(CURRENT_DATE) = '6' THEN '06'
WHEN DAYOFMONTH(CURRENT_DATE) = '7' THEN '07'
WHEN DAYOFMONTH(CURRENT_DATE) = '8' THEN '08'
WHEN DAYOFMONTH(CURRENT_DATE) = '9' THEN '09'
ELSE CAST(DAYOFMONTH(CURRENT_DATE) AS CHAR) END || ' ' ||
TRIM(CASE WHEN HOUR(CURRENT_TIMESTAMP) = '1' THEN '01'
WHEN HOUR(CURRENT_TIMESTAMP) = '2' THEN '02'
WHEN HOUR(CURRENT_TIMESTAMP) = '3' THEN '03'
WHEN HOUR(CURRENT_TIMESTAMP) = '4' THEN '04'
WHEN HOUR(CURRENT_TIMESTAMP) = '5' THEN '05'
WHEN HOUR(CURRENT_TIMESTAMP) = '6' THEN '06'
WHEN HOUR(CURRENT_TIMESTAMP) = '7' THEN '07'
WHEN HOUR(CURRENT_TIMESTAMP) = '8' THEN '08'
WHEN HOUR(CURRENT_TIMESTAMP) = '9' THEN '09'
ELSE CAST(HOUR(CURRENT_TIMESTAMP) AS CHAR) END) || ':' ||
TRIM(CASE WHEN MINUTE(CURRENT_TIMESTAMP) = '1' THEN '01'
WHEN MINUTE(CURRENT_TIMESTAMP) = '2' THEN '02'
WHEN MINUTE(CURRENT_TIMESTAMP) = '3' THEN '03'
WHEN MINUTE(CURRENT_TIMESTAMP) = '4' THEN '04'
WHEN MINUTE(CURRENT_TIMESTAMP) = '5' THEN '05'
WHEN MINUTE(CURRENT_TIMESTAMP) = '6' THEN '06'
WHEN MINUTE(CURRENT_TIMESTAMP) = '7' THEN '07'
WHEN MINUTE(CURRENT_TIMESTAMP) = '8' THEN '08'
WHEN MINUTE(CURRENT_TIMESTAMP) = '9' THEN '09'
ELSE CAST(MINUTE(CURRENT_TIMESTAMP) AS CHAR) END) || ':00' ||
char(39) AS TIMESTAMP)
Thanks in advance for any comments
Edited by: user10930658 on Mar 25, 2009 2:05 PM

timestampadd(SQL_TSI_SECOND, -second(current_timestamp ), current_timestamp )

Similar Messages

  • I want to create a new itunes account but keep the content.  Is this possible?

    My family has always used one Itunes account for all devices.  Now it is necessary for us to create a new itunes account.  We want to keep the apps, music etc that we each have now.  How can I do this?  Is this even possible?

    I hope this isn't too wordy but I want to be as clear and explicit as I can for you.
    You can't transfer purchases from one account to another account. Apple doesn't allow it.
    You can continue to use your daughter's Apple ID in order to continue to use the apps that you purchased with her ID and you will need to use her ID and password any time that you want to update those apps. What you do want to avoid is having to download any of those purchased apps again on any other devices - if you create a new Apple ID.
    If you create a new ID and then you sign into her ID in order to download a previous purchase-  you will lock yourself out of the new ID for 90 days and there is nothing that you can do about it. So as long as you do NOT download any past purchases with her ID - you will not lock yourself out of the new ID. So you can keep using the apps that were bought with her ID, you can also update those apps using her ID (you have to sign into her account in Settings>Store) but you can't download past purchases without messing things up with your new ID.
    When you download a past purchase with a different ID - you associate that device with the different ID for 90 days. This is one way that Apple hopes to cut down on pirating of apps - friends using other friends IDs in order to download apps without patting for them.
    This explains it in a little more detail.
    http://support.apple.com/kb/ht4627
    The bottom line is that you can create a new ID, still use her ID - judiciously - but you really want to avoid downloading past purchases with her ID. Transfer all of those purchases into iTunes so that if something happens and you need the purchased content again, you can just sync it again rather than downloading it.
    This explains transferring purchases.
    http://support.apple.com/kb/HT1848

  • Help with reducing the size of an image but keeping the quality

    Hello,
    I am wondering how do I resize an image but keep the quality. I am creating a folder design for work and I want to include 6 images on the back each of 156px x 118px.
    The images I have are slightly different in size but for example sake one of the images that I have is 225px x 158px. The quality is very poor when I reduce the size.
    I have tried changing the ppi to 72 and to 300, I have also tried resizing all in one go and in a number of goes and I have tried the bicubic sharpener but I have just had no luck with it.
    I am wondering if anyone can help with this,
    Thanks
    Tracy

    Hi Tracy,
    A couple of questions:
    I am creating a folder design for work...
    So this is printed? How large? Pixels are not a unit-of-measure for print.
    If for print, you are looking at ppi of 300 or higher AT PRINT SIZE.
    So, say you want a 3in x 4in picture. That would mean your original would have to be at least 900px X 1200px. (ie 300ppi x width, 300 ppi x height)
    If your original files are not at least that resolution.. . it is hard to add quality after the fact. Unless your are working with vector art.
    I have tried changing the ppi to 72 and to 300, I have also tried resizing all in one go
    Be sure to do that on copies of original. Keep in mind the PPI number by itself is completely meaningless. It only has use in describing a to be printed image when combined with the print size.

  • I created a website with iWeb but use GoDady for hosting it rather than MobileMe. The images on my Gallery page do not show at all on the external domain but they DO show when seen on MobileMe. Has anyone encountered this problem before? Many thanks!

    Hello al!
    I created a website with iWeb but use GoDady for hosting it rather than MobileMe. The images on my Gallery page do not show at all on the external domain but they DO show when seen on MobileMe. Has anyone encountered this problem before? Many thanks!

    Just create a new page (or use the existing photo page) on your external site and use html to add an iframe sized to the page and link it to the mobilme gallery page. Works for me just fine when showing my gallery from a yahoo site.
    like this
    <iframe scrolling="off" allowTransparency="true" frameborder="0" scrolling="yes" style="width:100%;height:100%;border:none" src="http://gallery.me.com/your_account_name"></iframe>

  • I wish to move time machine to a  new HD, but keeping the old backups on the new HD. New HD format (mac os plus (with register)). please help?

    I wish to move my time machine copies to a new HD, but keeping the old backups in the new time machine HD. The new HD format is Mac OS Plus (with register). When I dragg the backups.backuodb file to the new HD I got an error  message "The uppercase and lowercas of the volume....".
    Please help

    See Pondini's TM FAQs, for details.

  • My daughter created an itunes apple id but gave the wrong email so now I can't go to the email and verify her itunes account. I tried to create a new email with the email she put in and I can't because its already taken..,..help

    My daughter created an itunes apple id but gave the wrong email so now I can't go to the email and verify her itunes account. I tried to create a new email with the email she put in and I can't because its already taken..,..help

    Hi JkeeneSoldano,
    Thank you for visiting Apple Support Communities.
    To regain access to your Apple ID, try to reset your password using one of these methods:
    Answer your security questions. Use these steps if you know the answers to your security questions.
    Use email authentication. We'll send you an email that you can use to change your password.
    Use two-step verification. If you set up two-step verification, you can use it to change your password. You just need your recovery key and a trusted device.
    From:
    If you forgot your Apple ID password - Apple Support
    If you need to use the email verification method but don't receive the reset email, see this link for more help:
    If you didn't receive your verification or reset email - Apple Support
    Best Regards,
    Jeremy

  • How do I change the DNS settings to BC but keep the MX setting for emails?

    How do I change the DNS settings to Business Catalyst but keep the MX settings for emails?
    I'm basically created anew site using Muse and want to host it on BC and upgraded to the Web basics + to allow for hosting of downloadable pdf's etc.
    There are up to 50+ emails address set up on the current set up and I want to just change the NDS settings for the domain to ponit to the new site/hosting an not have to worry about them chaning all the meail settings etc.
    Records do I need to change in BC?
    Thanks
    Iain

    Hi,
    You shouldn't need to do anything as long as you do not state hosting email with BC.  Just ensure to check you DNS in a lookup tool that it's still referencing your external email service.
    Otherwise you can set up external email set-up if the option is present.
    - http://helpx.adobe.com/business-catalyst/partner/set-email-external-email-provider.html
    Kind regards,
    -Sidney

  • Is it possible to delete the table of contents in a pdf but keep the bookmarks?

    Is it possible to delete the table of contents in a pdf but keep the bookmarks?

    If the TOC is located on certain pages, you can simply delete those (from the Pages panel).
    Make sure it doesn't screw up with how your bookmarks work, though...

  • Is there a way to change the actual song file but keep the 'info'?

    I have a compilation that took me a really long time to edit (by which I mean put the date for each individual song in because they were all released different years becaues it's a Bob Dylan compilation and I have smart playlists for each decade from the 50's upwards) and I want to change the actual file in itunes but keep the data, is there any way? It'd take ages to do again because it's a 3-cd album. I'm trying to change the file because the one I have is approx 200kbps bit rate and i want to have a different, 320kbps version that i've downloaded. I've tried opening the file in explorer and deleting it so that i can 'locate' the file again to the one i want to replace it with, but it changes the song title, album artist, and tags etc to the new file, whereas i thought it would just retain the information but change the actual file it played.
    i've had a really hard time explaining this i'm sorry if it's unclear. i was just wondering if there was any way to avoid the painstaking process of googling each song to find its release date and manually entering it when i already have a perfectly organised album.
    i can't find anything anywhere about this, presumably because i've no idea what the key words for the search would be, so i'm sorry if this is common knowledge.
    thanks in advance

    VBR vs. CBR isn't a concern as far as the strategy is concerned. As given it is slightly easier if the replacement files have exactly the same files names and folders as the files they are replacing (case doesn't matter) but if that isn't possible we can work around that too.
    Not my area but I think CBR gives larger files and less processing overhead for the same quality, which is a somewhat nebulous term. I'm not sure there is any real benefit.
    Yes a script is just another kind of a program.
    iTunes gives each track in the database a unique ID and knows the path that the file is supposed to live on. If you replace the original file with a different file of higher bitrate that has the same filename then iTunes will use that new file next time it wants to play the track. When it does so it will also read the tag and update itself if any of the information is different.
    The original function of the ExportImport script was to help someone else rescue play counts from an old library database. If works by scanning through selected tracks and writing out a text file that contains an ID for each track and the data that wants to be copied back later.
    Here is a sample output from the export:
    <#>iTunes Metadata - Exported 19/12/2012 20:03:58
    <ID>E5C69360-306A28AF
    <#>AC-DC\AC-DC Live\1 Thunderstruck
    <Plays>12
    <ID>7C1D487C-3414298C
    <#>AC-DC\AC-DC Live\2 Shoot To Thrill
    <Plays>12
    <ID>0DCF32CE-1079174E
    <#>AC-DC\AC-DC Live\3 Back In Black
    <Plays>15
    Each block consists of the iTunes track ID, a comment so we humans can see which track this is, followed by one or more properties. I can write you a custom version of this script but I need to know exactly which properties you need to save and then restore. For example Name, Year, Genre, etc. You need to compare a new and old version of one of your songs and work out which fields need resetting in the new song to make it match the old one.
    Having saved a file with the information that would otherwise change, you can then delete the older copies of the file, or better yet move them to a backup location, then copy in the new versions. If the filenames match iTunes will "see" the new files automatically, otherwise my FindTracks script can normally fix the broken links. Once iTunes is connected to all of the new files you drag and drop the saved text file onto the ExportImport script to run the import phase. This applies the saved data to each track in turn.
    tt2

  • Is it possible to create a timestamp with an accuracy of 1ms?

    I want to acquire data with PCI-6023 and write them with a precise timestamp to a file. Is it possible to create a timestamp with an accuracy of 1ms?
    Maybe somebody can tell me experiences with logging data over a time periode up to 24 hours (and time-accuracy of 1ms)?

    Hi Hans, This forum is related to one of National Instruments' automation products rather than data aquisition. Perhaps you will acheive better results if you post your question to one of the "Measurement Devices" forms instead.

  • I sold my Imac and would like to wipe it out but keep the major programs is that possible?

    I sold my Imac and I would like to wipe it out passwords and all but keep the programs that have been purchased, is that possible and how do you do it?

    Not really. You should just start clean.
    Prepare Your Mac for Sale
    Boot from the OS X Installer Disc One that came with the computer.  After the installer loads select your language and click on the Continue button.  When the menu bar appears select Disk Utility from the Utilities menu.  After DU loads select the startup volume from the left side list then click on the Erase tab.  Set the format type to Mac OS Extended (Journaled) then click on the Options button.  Select the one pass Zero Data option and click on the OK button.  Then click on the Erase button.
    Note: You can skip the Zero Data option if you are not concerned about removing sensitive personal data from the hard drive.  If you choose to skip this part of the process then it is possible for others to recover data from the hard drive.  The Zero Data procedure will prevent others from getting access to your personal information.
    This process will take 30 minutes to several hours depending upon the size of the hard drive.  After formatting has completed quit DU and return to the installer.  Now complete the OS X installation.  At the completion of the installation do not restart the computer.  Instead just shut it off.  The next user will be presented with the Setup Assistant when they turn on the computer just as it would if new out of the box.

  • I can import my first clip to the video library, but not the second clip. I tried dragging-dropping and using the "E" key, but only the first clip will show up in the library. I use IMovie 9.0.9 and OSX 10.8.5. with no problems until yesterday.

    I can drag my first clip from the New Event window into the Project Library, but not the second. I can highlight the second clip in the New Event window, but it won't "drag". The "E" key works for the first clip, but not the second.I've been using IMovie daily and the problem just appeared. No upgrades to the computer and no new software installed.  IMovie 9.0.9 and OSX 10.8.5

    Thanks victoryhat.  I learned some new things from this very clear tutorial.  But it didn't answer my question about why the titles don't stay with the video when I export it.
    He did mention something that might be a clue however.  When he talked about importing a title he created as an image, he noted that he was careful to make the image the same size as the video he was adding it to: 1280 x 720.  Since I took the video with an iPhone in the vertical position, my video image isn't the same size and orientation as the titles.
    Maybe there is a way I should be setting the screen for this size???  I'll go back and play around.  Meanwhile thanks for alerting me to Gary Rosenzweig's MacMost tutorials.  Very clear.  I'll look for more.

  • Switch image in a layer but keep the layer mask

    Hi, I`m trying to swich a image on a layer whit a layer mask. I whant to keep the layer mask but change the image. When I paste a copyed image it the laye it creates a hole new layer. How can I change a image but keep the layer mask? 
    Tanks Lasse

    You have things backwards: You copy&paste the layer mask and/or duplicate a selection by loading it using Ctrl+click on the thumbnail, then creating a new mask from it. After that you can delete the original layer. Also more recent versions allow drag&drop replacement of this stuff, but you have to be careful which thumbnail you drag...
    Mylenium

  • What is the best way to erase half of an image but keep the other half of the image and make it look real

    I have an image of bracelet with a tube in the middle and need to erase the tube but keep the bracelet to make it look as though the tube was never there, what's the best tool in CS6 to use

    Look at the Content Aware Patch,  Healing Brush, and Spot Healing Brush tools.
    Photoshop Help | Content-Aware Patch and Move
    Nancy O.

Maybe you are looking for

  • Showing multiple values problem..

    What's up, I have a question and hopefully somebody can help :) Let's say I have a table called "Store_Employee" which have 2 columns ( Employee_SSN , Store_ID ) lets say 2 employees work at Store_ID=1 , i want that when I enter "1" in Store_ID , the

  • GO_ITEM is not working in trigger WHEN_VALIDATE_ITEM

    GO_ITEM is not working in trigger WHEN_VALIDATE_ITEM Here is my code... IF TRIGGER_NAME = 'WHEN_VALIDATE_ITEM' THEN FND_MESSAGE.DEBUG('Error!); GO_ITEM('abc.xyz'); END IF After I clicked 'OK' on the message the GO_ITEM doesn't point to the desire ite

  • Syncing Illustrator settings

    I have a problem with syncing Illustrator settings. I just installed CC onto another computer and tried to sync settings from the cloud to the new installation of illustrator, but nothing happened. It worked OK for Photoshop and Dreamweaver, but AI d

  • Holiday not reflecting in Period Work Schedule of employees

    Hi friends I have a serious issue here.  I have created  a Floating public holiday and assigned to my Holiday calendar which comes on 23rd of May.  When I regenerated the Work schedule rule, it is reflecting showing holiday class as 01 and day type a

  • IllegalAccessError passing object with RMI

    Hi, I am playing with RMI at the moment. I have a Remote class that implements a Remote interface The interface has one method which the class implements and this is to get a TestSerial object. If I run without using a Securitymanager then there are