A real headache...

Hi all

In response to another thread, I worked on a problem, and I came across a real headache.

The statements of table and insert are at the end of the post. What I want is if seconds
are greater than 29, to round to the next, so less than 29, minute round down to the
minute – i.e. with 00 seconds - i.e. the seconds are not displayed in time - just
the minute as new calculated - if it has changed.

The result of the query below is here - the first field is the date with seconds - the
second is changed - if indeed it changes.
2012/MAY/15 14:56:00 2012/MAY/15 14:56                                                                                                                                                                                                                          
2012/MAY/15 14:57:00 2012/MAY/15 14:57                                                                                                                                                                                                                          
2012/MAY/15 15:00:40 2012/MAY/15 15: 01                                                                                                                                                                                                                         
2012/MAY/15 15:00:40 2012/MAY/15 15: 01                                                                                                                                                                                                                         
2012/MAY/15 15:00:45 2012/MAY/15 15: 01 
The really interesting thing is how there is an extra space between the: and the minutes in
the case of the seconds being above 29. The request is here
select to_char(starttime, 'YYYY/MON/DD HH24:MI:SS') || ' ' ||  -- this line is a control - I'm able to see the original dates.
  case when to_number(to_char(starttime, 'SS')) <= 29 then to_char(starttime, 'YYYY/MON/DD HH24:MI') 
          when to_number(to_char(starttime, 'SS')) > 29   then to_char(starttime, 'YYYY/MON/DD HH24:')
      || to_char(to_number((to_char(starttime,'MI')) + 1), '09')
  end
from trans
The definition statements and table insert are under my signature. I am really baffled by the present
any help appreciated.


Paul...

CREATE TABLE TRANS
(
  CALLTYPE     NVARCHAR2(6),
  ORIGANI                 NVARCHAR2(40),
  TERMANI                 NVARCHAR2(40),
  STARTTIME               DATE,
  STOPTIME                DATE,
  CELLID                  NVARCHAR2(10),
  CONNECTSECONDS          NUMBER,
  SWITCHCALLCHARGE        NUMBER
)
/ 

 
INSERT INTO TRANS VALUES ('IN','555988888','222772088',to_date('05/15/2012 11:05:05','mm/dd/yyyy hh24:mi:ss'),to_date('05/15/2012 11:05:39','mm/dd/yyyy hh24:mi:ss'),null,34,18000)
/ 
INSERT INTO TRANS VALUES ('MSG','555988888','222772088',to_date('05/15/2012 11:05:04','mm/dd/yyyy hh24:mi:ss'),to_date('05/15/2012 11:05:38','mm/dd/yyyy hh24:mi:ss'),'2793',33,null)
/ 
INSERT INTO TRANS VALUES ('IN','555000010','222772081',to_date('05/15/2012 07:38:53','mm/dd/yyyy hh24:mi:ss'),to_date('05/15/2012 07:40:01','mm/dd/yyyy hh24:mi:ss'),null,8,18000)
/ 
INSERT INTO TRANS VALUES ('MSG','555000010','222772081',to_date('05/15/2012 07:38:51','mm/dd/yyyy hh24:mi:ss'),to_date('05/15/2012 07:38:09','mm/dd/yyyy hh24:mi:ss'),'27d1',27,null)
/ 
INSERT INTO TRANS VALUES ('IN','555000010','222772081',to_date('05/15/2012 07:59:40','mm/dd/yyyy hh24:mi:ss'),to_date('05/15/2012 08:01:00','mm/dd/yyyy hh24:mi:ss'),null,80,36000)
/ 
INSERT INTO TRANS VALUES ('MSG','555000010','222772081',to_date('05/15/2012 08:00:01','mm/dd/yyyy hh24:mi:ss'),to_date('05/15/2012 08:01:20','mm/dd/yyyy hh24:mi:ss'),'27d2',80,null)
/ 
INSERT INTO TRANS VALUES ('IN','555988889','222772088',to_date('05/15/2012 14:54:12','mm/dd/yyyy hh24:mi:ss'),to_date('05/15/2012 14:54:59','mm/dd/yyyy hh24:mi:ss'),null,47,18000)
/ 
INSERT INTO TRANS VALUES ('IN','555988889','222772088',to_date('05/15/2012 14:56:00','mm/dd/yyyy hh24:mi:ss'),to_date('05/15/2012 14:56:30','mm/dd/yyyy hh24:mi:ss'),null,30,18000)
/ 
INSERT INTO TRANS VALUES ('MSG','555988889','222772088',to_date('05/15/2012 14:57:00','mm/dd/yyyy hh24:mi:ss'),to_date('05/15/2012 14:58:32','mm/dd/yyyy hh24:mi:ss'),'27cf',32,null)
/ 
INSERT INTO TRANS VALUES ('IN','555988888','222772000',to_date('05/15/2012 15:00:40','mm/dd/yyyy hh24:mi:ss'),to_date('05/15/2012 15:01:40','mm/dd/yyyy hh24:mi:ss'),null,60,0)
/ 
INSERT INTO TRANS VALUES ('IN','555988888','222772000',to_date('05/15/2012 15:00:40','mm/dd/yyyy hh24:mi:ss'),to_date('05/15/2012 15:01:40','mm/dd/yyyy hh24:mi:ss'),null,60,36000)
/ 
INSERT INTO TRANS VALUES ('MSG','555988888','222772000',to_date('05/15/2012 15:00:45','mm/dd/yyyy hh24:mi:ss'),to_date('05/15/2012 15:01:45','mm/dd/yyyy hh24:mi:ss'),'27cf',60,null)
/ 
 
commit
/ 

Paulie says:
>

The rounded for this function.

I have not used the ROUND function. Thanks anyway - any other ideas?

Paul...

I modified my post to answer your question in full. Please check.

My point was that the round function would be a much more clean way to achieve the desired result.

See you soon,.

Tags: Database

Similar Questions

  • Problem error failed to set KB2345886. It's a real headache! help, advice appreciated.

    Problem error KB2345886

    See the following topic for your question

    http://social.answers.Microsoft.com/forums/en-us/vistawu/thread/c82fa2ea-6c79-49D1-9AF1-c5c13287dea9 >

  • A real headache - no card in the CFMAP!

    I have two CF servers, test, and production. The same two performance version of CF (9.1), both have valid a card key. Both can show Google maps the "harsh" (without CFMAP). Both have their respective key card stored in the server settings.

    A single server, it works:

    < CFMAP Hollows = 'St. Louis, MO' width = "400" height = "400" name = "mainMap" >

    < cfmapitem address = "New Orleans, LA" >

    < / CFMAP >

    One of the other it produces a blank screen.

    test server: http://173.161.10.61/TCI/test.cfm -works

    production server: http://www.thecareerindex.com/test.cfm -does not

    No idea why one works and the other does not?

    I don't know why, but the version of prod is having a JS error:

    Error: _1d.markerItems is null
    Source file: http://www.thecareerindex.com/CFIDE/scripts/ajax/package/cfmap.js
    Line: 64

    I'm not sure it's really a lot of help, it's one of the internal files of the given own CF.  You run the same patch level of the CF on both boxes?  Exactly the same code?  Same JVM?

    --

    Adam

  • Apple TV remote turns on randomly 4th Gen Apple TV

    Hi guys,.

    I have a 4th gen Apple TV for Christmas at work. It's pretty convenient, but it's a very weird thing: the remote control sends signals randomly when nobody is in contact with it, in fact, nobody is there, everyone is metres from the remote control. Since Apple TV is connected to my TV which is capable of HDMI-CEC, it also turns on the TV. Sometimes without any model, when we sit in the corner opposite of the same room, or at random times of the day or even at night. Sometimes I go out in the middle of the night to check on our little girl and I see that the TV is on. Apple TV will switch to standby after a certain time, but since it does not send SIGNAL to the TV via CEC, the TV stays on. Sometimes I stop the movie I'm watching something and when I come back, film runs and minutes. This causes me a real headache, not to mention that it also adds the power bills, especially when we leave for a weekend and I come home that the TV is on...

    Did any of you ever heard, or it's a faulty remote with a contact problem around the buttons that need to be replaced? If the first case, how can I fix this, if the latter, will change any Apple retailer for me? There is no Apple store dedicated to Christchurch, New Zealand. My employer has ordered hundreds of Apple TV Online.

    Thank you

    Laz

    I don't have to assume that someone else uses one of the old silver remotes close to Apple TV or if someone could play a joke on you with a distance more or the Apple remote on their phone app.

    There was a small number of reports related to the buttons on the remote apparently stick and sending several times the same command, but I don't think I've seen all the reports to work intermittently on his own.

    I've seen reports where network activity has awoken from previous models, but never where this kind of activity began a movie plays when he suspended.

    I think that a good start in the resolution of what is going on here is to know if these red orders arrive via bluetooth, IR, or wifi, you could start by covering the unit to the rule (or in) re.

  • Office 365 calendar items change to the meeting requests

    I used my iPhone for years and synchronization with a local Exchange 2010 Server (on-site).  Last week, I've upgraded to Office 365 online Exchange 2013.  I always use the default Mail and calendar app on my iPhone.  However, I have a problem where my calendar appointments are "converted" into "meeting requests" whenever I have change the appointment on my iPhone.  It is very annoying.

    Here are the exact steps to reproduce this problem:

    1. create a date from the calendar in Outlook.  (I tried this on 2010 and 2016 with the same result).

    2. wait for appointment sync to your iPhone.

    3 open the appointment on the iPhone and change the START TIME.  Just move it before 1 hour.

    4. wait until it syncs again.

    5. now, open the appointment on the calendar in Outlook, and you will see that it is now defined as a "meeting request".

    6. the only way I found to fix it is to click on 'Cancel the Invitation' inside Outlook and then save again, the appointment.

    It is at the origin of the real headache!

    I tested INTENSIVELY and the steps above the problem to happen every time.

    I also tried the same scenario with an Android phone (using the calendar app) and it works fine.  It does not cause the weird happen meeting invitation.

    I also tried to use Outlook to iOS, and it works very well with this application.

    So this seems certainly to be affected ONLY by the default iOS calendar app.

    Help!

    Have you already found the solition for this annoying problem?

  • iMac - screen Calibration two iMacs

    Hello everyone

    Someone has advice or tips on how to use the utility of calibration of apples own monitor? I am trying to get two iMacs look even.

    We have two iMacs at work, one is a 27 inch (end 2013) and the other is a brand new 27 inch Retina. Both are 3.2 GHz Intel core i5, and the two are running OSX 10.11.2. We do not work for printing (for the moment anyway) but I don't want the two screens to look the same, that we work together on the same projects. We cannot extend to a material standard, so I tried to use the Apple monitor calibration utility. In addition, I find it really hard to use, (give me a real headache squinting at the thing tiny apple!) it produces completely different results.

    I realize that the new is a Retina display and also has a different graphics card, (an older AMD Radeon R9 M380, the other has a NVIDIA GeForce GT M 755) and so they are different, but I thought that calibration should at least have their similar but they are miles! I have the color of background on a dark - gray middle on both, but they look just so different.

    I tried a demo of SuperCal but came out shocking! He made the model of the retina really dark and yellow!

    Anyone has any advice or know one better material another utility that could produce better results?

    Kind regards

    David

    First of all, I wouldn't touch the settings of the retina. Your best chance is to play with the settings on the older iMac. The problem is the iMac of the retina is so much better, it will be impossible to match the two.

  • Difficulty to El Capitan stuck when connecting

    Last month I upgraded 10.11.1 and could no longer connect my system.  I would like to enter my password correctly and then the cursor would change roulette spins and just stay there forever.  The only way out was a power off reboot.  Later, I found that when he was in this State, I was able to SSH in from another machine, and the system log revealed that/usr/libexec/lsd (the demon Services launch) was crashing repeatedly.  I searched these forums and others and found a lot of ideas, and none helped.

    No problem, however, I've got hourly backups time machine, right?  Well, no.  Apparently El Capitan did not have hourly backups so my most recent backup performed for some time in October, which was a month at the time.  Not good.

    Fortunately, I had a former boot disk that I put in an external enclosure and was able to start to experiment.  The drive that I normally starts since was well - checks and repair disk permissions and everything that everything came back good, and I could read and write files in there very well.

    After much experimentation and frustration, I was on the point of abandon and add another drive for a clean install and start moving more - a process that I * really * hate to do.  But one last Web search and hopefully kicked my last set.

    To do this, you'll need to be in a recovery, or ssh console in the machine or otherwise somehow to get to a command prompt boot from an external drive.  Once you're there, follow these steps:

    find/private/var/folders / | grep com.apple.LaunchServices | grep csstore

    Note that if you boot from an external drive, you must run this command on the boot disk you are trying to fix.  Just add the/Volumes/Whatever_Your_Boot_Drive_is the path, as follows:

    find/Volumes/YourBootDriveHere/private/var/folders / | grep com.apple.LaunchServices | grep csstore

    Who will find the database cache that uses Launch Services.  They have long, random searching for names that end with csstor.  Note each illustrates file, then delete them, by a command like this (obviously using some paths command above found instead of this example):

    RM /private/var/folders/cd/someLongRandomNameHere/someFolderNumberHere/com.apple.L aunchService - whatever.csstore

    If you are more careful, you can rename rather than delete them, so you can put back them if necessary.  Which would look like this:

    MV /full/path/like/shown/above/to/whatever.cssstore /full/path/like/shown/above/to/whatever.csstore.backup

    After you delete or rename these files, restart your Mac.  You should now be able to connect.  Or at least it's finally, what worked for me.  The connection has taken longer that normal - a few minutes - to regenerate these files, but the office finally appeared, and now I'm back to running on my normal boot drive.

    Hope this helps someone.

    Wow man you are a genius

    I had my f...d iMac for 4 days after an update of 10.11.1 10.11.2, and he started to give me a real headache.

    I did what you described, and it worked great!

    Thank you very much!

  • HP Envy 23: How can I install Windows 7 Pro Windows 8.1 pre-installed slim like 23?

    Hello... I HATE 8.1... but I saw your list of wonderful driver for your laptop and I was wondering if it is similar to a HP desktop computer when removing windows 8.1.   I already asked HP for help, but they, unfortunately, are "unable" to tell me that I can even load Windows 7 23 want.  People very nice, but very limited information.

    I managed to find 2 new copies of Windows 7 Pro, more a have on hand software... obviously, until Windows has the world dislikes phone applications on a computer, we need backup copies!

    My brand new mess is a HP Envy 23 I just bought last Sunday and hates carefully.

    I got the USB backup, just in case, but to wipe the drive (if I can) and change the boot order (if I have will be tolerated), and of course, eliminating all additional platforms I could find if this is possible)... What do I need to save the facility from 8.1 to make bits andpieces and love its color and whatever work?

    And what on Earth is UEFI?

    Thanks in advance... I know that this forum is a labor of love.

    Six days in a 30 days return... Help!

    Knowing the complete model of the computer help, HP Envy 23-xxxxxx

    Try to downgrade your system would probably void your warranty and a challenge trying to find drivers that would work with Windows 7, a real headache.

    If you want to go this route, you need to disable secure boot and enable legacy in order to change the boot order.

    It may be easier to keep what you have and make it Windows 8 look like Windows 7

    http://www.eightforums.com/tutorials/50124-Windows-8-1-make-look-feel-like-Windows-7-a.html

    or this:

    http://www.MakeUseOf.com/tag/make-Windows-8-8-1-look-like-Windows-7-XP/

  • How to send contact information via text and create a contact as a google contacts

    Does not work how do either, if I create a contact on the phone, it will not synchronize with google, real headache.

    Sorry you won't find 2.1 on your phone on the Dext. I think you could get a better result from other owners of Dext at Dext forum.

    It seems that your contacts are saved and synchronize different for the Cliq.

    Wish I could be more useful.

  • Atrix: No option to link contacts

    I feel a little like I'm losing my mind here. I had my Atrix for a few weeks now (switched from an iPhone) and especially, I love it, but I can't find the option to make all contacts. With friends who have many Facebooks, Twitters and others, is to learn to be a real headache.

    I've been using the options on the phone and the tutorial to & site you, so I know where it is supposed to be. Once I opened a contact in should be able to press the menu key and get "link the contact", optional. The problem is that the option is not there.

    Does anyone else have this problem? Does anyone have an idea how to solve this problem?

    Thank you

    Heather

    This may answer your question:

    https://supportforums.Motorola.com/message/404702#404702

  • Totally to the U410 - the default factory reset format?

    Thing, is that I bought this IdeaPad U410 about two months and less than a month has just decided to format and install Ubuntu, because I didn't like Windows 8. But, as I should be, since that day my life has become a hell of bugs and incompatibility issues. I just could not afford it and decided to returned to the Microsoft Team.

    I had all my Lenovo and WinRecovery partitions intact. Then, I tried these always

    -Use the key to recovery, to restart the plant; somehow, his right boot Ubuntu.

    -Use my flash driver with the system recovery of Windows 8, but he says it's "impossible to reset your PC. A partition of required driver is missing. "

    In a desperate approach I followed a few steps to eightforums and by using diskpart I completely erased my HD (after make a backup of the Lenovo and WinRecovery partitions) - and... It did not work. Now, I am lying here with a computer without operating system or data.

    Yes, I'm a genius. Have I not hope to solve it (recovery of factory default) or better start to use the laptop as the most expensive paper weight ever?

    Hello

    Well, before you do that I realized that I had nothing to lose and wipe all my hard drivers (the SSD and HARD drive) using the command prompt of Windows 8 recovery system via USB. I still couldn't install W8, but later I tryied Ubuntu 12.10 and now it has worked flawlessly.

    I do not recommend this because I don't know if in the future this can be a real headache for me, but now, it is perfect and, in addition to the installation of the graphics card, I have no problem.

    In any case, thanks Pascal, I'll keep your suggestion and if necessary I'll contact lenovo support.

    Detective Conan!

  • Windows continues to change user profile folder

    Hi all
     
    I'm facing a real headache. My computer continues to change user profiles folder every restart 2 or 3. For example, my user name is MSF\Bob. The user profile folder has been C:\Document & Settings\Bob. After a restart, Windows create a C:\Document & Settings\Bob.MSF then Bob.MSF.000 and Bob.MSF.001 folder and so on.
     
    Someone has an idea why this is happening and how I can prevent this?
     
    I thank very you much in advance!
     
    Best regards

    Easy question to answer.  You simply have a corrupted profile.

    When Windows detects a corrupted profile, it automatically generates a temporary with names profile as you describe.  Usually, these profiles are deleted when you connect your computer turned off, but not always.  The solution is quite simple.  You just need to recover your corrupt profile.   There are two general approaches.  One is to do a system restore to a point in time before the profile was first damaged.  The other usually involves the creation of a new user and moving profile data on to the new user (you may reset some of your settings).  To do this, choose one of the following articles and follow through:

    "How to recover damaged Windows XP user profile"
      <>http://support.Microsoft.com/kb/555473>

    "How to copy data from a corrupted to a new profile in Windows XP user profile"
      <>http://support.Microsoft.com/kb/811151 >

    "Windows XP problems if your profile is corrupted"
      <>http://support.Microsoft.com/kb/326688 >

    HTH,
    JW

    PS: Corrupt profiles are almost always accompanied by alteration of the disc as well.  After your recovery, perform a check disk (chkdsk) with the "/ R" or "/ F" option

    "How to perform disk error in Windows XP check"
      <>http://support.Microsoft.com/kb/315265 >

  • connectionID in dll lvrefnum

    I'm looking for information about the data type of LVRefNum and how to translate them for the use of the DLL.  I have a network configuration using UDP.  The Protocol that we put in place, we want to allow other users to interface with, therefore the DLL for C++ and VB users.  I created four base screws (functions): open, read, write, close.  My question is that the connectionID labview makes open UDP.  I want to pass this ID to the C guys so that they can manipulate the election for the other functions as needed.  When I create the DLL, it tells me that the login ID is a type of LVRefNum.  From what I've read on other threads on file, visa refnums activeX, etc, it's a real headache.  Some people say type perform a cast to a 32, and which should work fine. others say that these refnums are very specific and type-casting does not work.  So, what's the problem?  I like a very clear answer what to do for my situation.  My goal is have this connection ID as an exit from the function of opening and as an input to read, write and close.

    The login ID for TCP and UDP primitives is an identifier of uInt32. You should be sure cast on a uInt32 pass in and out of the dll. Just make sure that callers know how limited that id is will be meaningless in another instance of LabVIEW and it persists after the connection is closed or LV is restarted. If you manage the error invalid argument (code 1) in your code to G, then you should be sure the callers abuse it.

    Nathan

  • Download 0x8007001F error message when you install the latest updates in Windows XP.

    Original title: problems with the update of my compooper (computing)

    Windows will not update it after updates KB2707511, KB2699988, KB2709162, KB2685939, KB2510531, KB2544521, KB2718704. I already got an answer to a clean boot and I did with no results, I also re installed IE8 with still no result. I get the 0x8007001F error code and all these updates keep in default even after using Mr. Fixit. This becomes a real headache. My computer is constantly freezing up and I lost my audio controls, it does not at the moment where opening tabs announces that there is a long list. Please, someone give me a remedy for this nightmare.

    Your suggestion of a clean boot is not resolution, I first had to remove a virus with Norton and then install the latest version of IE 8, then updates went through. I also had to use the Norton Power Eraser program in order to irradicate of other inhibitory start-up problems which were deeply rooted in my hard drive. Thank you for your attempt to help me, but I was the one who had to understand this. Now, my computer is high and GREAT work! I would say that MSN and Norton to collaborate in trouble all program and incorporate into the program of Mr.Fixit you who will remove the virus and update at the same time in order to avoid such a period of long downtime for all customers who have similar problems.

    Sincerely,

    Clinton joints

  • Pavilion DM1: Problems upgrading to Windows 10 on HP Pavilion DM1 Notebook

    The portable computer is currently running Windows 7 Professional, and I ran the upgrade of Windows 10.  It goes through the first installation and re - start and then on the second phase, when it is installing the drivers, it gets to 71% and restarts with a blue screen, I think that showing as TENT RUN OF No. EXECUTE MEMORY, but it is not very long, so I do not know and rolls to Windows 7.  I tried to disconnect external devices, try a clean boot, tried to update all the drivers, disable wifi and leaving on a single connection to the local network without success.  I managed to last updated desktop for Windows 10 with only a little difficulty even if Windows has decided the display driver is not compatible, so it is a real headache.

    Thank you. No, Kaspersky has not been installed, and I never installed it. Is used by McAfee, as sometimes it comes with Acrobat Reader? I installed once in an update and it removed immediately. Anyway, I found this file registered twice in C:\Windows\System32\Drivers and in a subfolder, it was not related to any existing process so I removed it, tried the upgrade again and he completed this time. If for any other person having this problem find the name of the file after ATTEMPTED RUN OF No. EXECUTE the MEMORY when the blue screen appears, which is very short and then delete this file. In my case it was kl1.sys. It was not however reflected in the report which appeared after system restored to Windows 7. Problem solved.

Maybe you are looking for