Simpler ways of calculating years between
Hi again,
I would appreciate numerous versions of calculating years between in years of age
i think there should be simpler ones than this below:
SQL> select floor(months_between(hire_date,dob)/12) age from employee;
AGE
38
32
30
46
39
25
32
46
39
33
10 rows selected.
many thanks
cube60
The EXTRACT approach will return wrong age counts for persons having their birthday in this current month, on a given day in this current month but after today.
Age by minus is also not always accurate.
E.g:
SELECT nr
, birthdate
, trunc( months_between(sysdate,birthdate) / 12 ) age_by_months_between
, trunc((SYSDATE - birthdate)/365.25) age_by_minus
, EXTRACT(YEAR FROM((trunc(SYSDATE)- birthdate)YEAR TO MONTH)) AS age_by_extract
, floor(months_between(trunc(sysdate),birthdate )/12) age_by_floor
FROM <table>
Results:
BIRTHDATE AGE_BY_MONTHS_BETWEEN AGE_BY_MINUS AGE_BY_EXTRACT AGE_BY_EXTRACT2
23-4-1962 45 45 46 45
25-4-1950 57 57 58 57
15-4-1990 17 17 18 17
21-4-1958 49 49 50 49
20-4-1991 16 16 17 16
26-4-1981 26 26 27 26
14-4-1971 36 36 37 36
15-4-1947 60 60 61 60
12-4-1955 52 53 53 52
12-4-1966 41 42 42 41
12-4-1963 44 45 45 44
12-4-1974 33 34 34 33
12-4-1983 24 25 25 24
12-4-1959 48 49 49 48
12-4-1942 65 66 66 65
12-4-1959 48 49 49 48
12-4-1947 60 61 61 60
25-4-1932 75 75 76 75
It seems that months_between is always correct.
Regards,
MH
Similar Messages
-
Calculating years between 2 date fields
I am trying to build a form in LiveCycle Designer 7 to report missing persons. I would like to populate a text field with the number of years between two dates entered in date/time fields; specifically using a missing person's DOB and the date they were last seen to calculate their age when last seen.
Any assistance would be greatly appreciated.
Thanks
DrewGreetings,
I need an age in months and years.
On my LiveCycyle form I have two date fields 'dob' and 'rdtestdate'. I am in Australia so we use dd/mm/yyyy as the format.
The field designated to display the calculated result -- 'rdage' -- is set as a calculated-read only text field.
What javascript/formcalc code would I use to calculate the age in years and months, please?
I've been studying and testing the various solutions but don't understand well enough, sorry! When I paste in a sample and change the field names to match mine, my result remains empty. Sometimes I get a failed script message as I try to save the form. I've tried quite a few different scripts to no avail.
Thanks for any assistance.
jeannie -
Simple Way to Track Photos Between Multiple Macs?
Hello, everyone. I hope you are doing well.
My wife and I take photos and video with 2 different iPhones, a Nikon SLR, a Panasonic compact digital, and a Flip HD video recorder.
I put the photos I take on my Mac Pro. She puts the photos she takes on her iMac.
I was wondering if there was an AppleScript or some automated way for me to see which photos and videos that I have on my Mac Pro that aren't on her iMac.
I realize I can now Share my entire Library with her iMac, but I'm guessing the performance of streaming thousands of 5-7 meg photos and 30-100 meg movies isn't that great. However, to be honest, I haven't tried it yet.
But my guess is I need a way to identify the images/videos I have that she doesn't have and then copy them over to her iMac.
Any ideas?
Thank you so much!
ScotHow are your two Macs connected? Do you have a hard wired LAN? If so then the optimal way of sharing a library between the two Macs is to put a single library on an external FW hard drive connected to one of the Macs and have both of you use the same library, but not at the same time. If you go this route you can merge your two existing libraries into a new library with the paid version of iPhoto Library Manager and eliminate any duplicates in the process.
If you're connected wirelessly it's not recommended to run/share a library wirelessly as you will encounter occasional dropouts and that can corrupt the library. When that happens you're in a good position of losing all your organizational efforts. You'll not lose the photos/movies, just the organization and you may have to create a new library from the existing original files in the damaged one.
If you want to be able to keep both your libraries identical as to content you can use iPhotoSync
Here's how it works:
1 - it compares the databases and/or album.xml files of Libraries A and B.
2 - the files in A that are not in B are imported into B by copying the original files from A into B's Import folder.
3 - it then does the same for B.
4 - metadata is not copied.
5 - it can be password protected to prevent unauthorized use.
It can be used to just copy from A to B and not sync both ways if desired.
Any keywords, titles, places or faces added in one library will not be copied with the photos to the other library - just the photos get copied. -
Everyone is often so quick to bash all these 'cleaning' utilities but rarely give any solutions.
There's a lot of critiques and endless lists of what NOT to do to avoid performance problems.
My Powerbook is 3 years old. It runs like molasses... SLOW.
I'm not a computer geek, but I'm smart and understand quite a bit more than a newbie.
Do I need a degree in computer engineering to fix/speed up my mac?
Yes, I know, the cleaning utilities suck. But is it really true of all of them?
I'm not totally convinced because there seems to be such a huge market for them.
Sure, there's a huge market for bottled water too, so maybe they are just useless/marketing crap, but I really want to return to my original speed performance quickly and can't seem to find out if it's possible with a utility.
I'm not willing to sit down for 3 hours and study line by line b.s. about how to fix it.
I have no problem if it's not fixable. I've always assumed operating systems outgrow their hardware's capacity to keep up, and sell my old one for a new one, no prob.
I don't care, really, but again, I'm curious if there is any quick, easy, user-friendly utility or method that I can use to return the speed performance I had as recently as a year ago? (I'd be satisfied with that).
Anyone willing to bite on that? Anyone willing to not critique, complain, tell me what NOT to do and actually know a solution?
IS THERE ANY SIMPLE WAY TO RETURN SPEED PERFORMANCE BACK TO (OR CLOSE TO) ORIGINAL FACTORY SPEED AFTER ABOUT 3 YEARS OF RELATIVELY STANDARD USE?
The only thing I may have done outside of the norm was some video editing, but very little.Look for solutions here:
https://discussions.apple.com/docs/DOC-3521
https://discussions.apple.com/docs/DOC-3353
Ciao. -
Simple way to create a "RANK" on a graphical Calculation-view ?
Hi guys,
I've saw some articles around, about creating a "Rank" column, in order to select TOP N inside analysis level (Design Studio in this case).
The problem is, that all of them were incredibly complicated (comparing....), And I wonder if there's a simple way to any "Rank" function these days (or in future versions).
My source:
SAP HANA: Implementing RANK using Graphical calculation View
Thank you,
Or.Hello Or,
Using Script based view, you can use RANK() function.
From Graphical, I have not found any way to implement RANK. So will have to wait along with you to know, if there is an easier way to implement rank from graphical calculation view.
Regards,
Krishna Tangudu -
Best way to transfer data between loops?
Hi, whats the best way to transfer data between loops(state machines, regular while loop etc) in labview. For so many years ive been using local variables but these can cause race conditions. Anyone advise?
StuIt depends one the structure of the loops and how they need to exchange data (unidirectional, bidirectional, broadcasting).
The simple case of one loop passing data to the other loop: producer/consumer design pattern using a queue
If the structure already contains an event structure: User Events
The way I code is documented in my community nugget on events
I often mix this with producer/consumer.
Felix
www.aescusoft.de
My latest community nugget on producer/consumer design
My current blog: A journey through uml -
Any way to split library between multiple hard drives?
I recently purchased an Apple TV and started 'really' using iTunes for all of my music and videos. Is there a way I can keep my music on my iMac's hard drive and my videos on an external without switching libraries and still keep it (at least the video hard drive) organized?
I had the same problem awhile back...the way I got around this was to create 2 separate libraries with a simple way to switch between the two...I"ve got one library on my Local Powerbook drive which I named "local" and one on my ext drive that I named "External"..Download the script "iTunes Library Manager" by Doug Adams.. http://www.dougscripts.com/itunes/itinfo/ituneslibrarymanager.php
It's a simple little script that will help you switch between the two. You wil have to move your whole library over to your HD first...then just move the albums/genres/whatever you want back to the local library on you Laptop. Just follow the directions with the script. You should be fine -
Is there at all a simple way to set the export size of a SWF?
Need Help!
I created an animated banner for class, using a standard size. It ended up way to small, but all the element and text animation is done. I can easily change the document size, but everytime I try to enlarge the elements, they pixilate and lose all visual integrity (not to mention its enough work to resize between all the tweens that I might as well start over). However, resizing the actual SWF output proves the elements can handle being a larger size without any pizilation or degrading - it looks great much larger than the initial export. Is there at all a simple way to just have Flash 5.5 export the same banner SWF at a larger size? Please help!you can load (dynamically) your banner into another swf and resize it in the main (loading) swf.
-
Need a simple way to view a professionally made DVD.
I'm new to Macs (2 weeks) after 13 years in Windows. I have a DVD a professional made for me for our 25th Wedding anniversary. I have been able to play it on my Windows notebook but it freezes after about 40 seconds on the Mac.
It starts with a still photo in which there is a small frame with script running. You click on it and the main series of photos and music start.
I copied the folders and files from the DVD to a folder on the Mac. There are two folders: AUDIO_TS (which is empty) and VIDEO_TS.
VIDEO_TS contains the following files: VIDEO_TS.BUP, VIDEO_TS.IFO, VIDEO_TS.VOB, VTS010.BUP, VTS010.IFO, VTS011.VOB, VTS020.BUP, VTS020.IFO, and VTS021.VOB.
I purchased and installed QuickTime MPEG2. I can view the .VOB files, but there is no music and I can't make it run as a complete video.
I have absolutely no experience with any video editing and know nothing about handling these types of files.
I have a DVD that I can view on my Windows laptop and in a standard DVD/TV player. I was just hoping to be able to have it stored on my Mac and be able to view it.
Is there a simple way to accomplish this?I'm new to Macs (2 weeks) after 13 years in Windows. I have a DVD a professional made for me for our 25th Wedding anniversary. I have been able to play it on my Windows notebook but it freezes after about 40 seconds on the Mac.This may be normal. It could be your Mac DVD Player simply doesn't like the disc brand or a dirty lens interrupting the continuous throughput.
I copied the folders and files from the DVD to a folder on the Mac. There are two folders: AUDIO_TS (which is empty) and VIDEO_TS.This is normal. The AUDIO_TS folder is just there for compatibility with earliest models of DVD players.
I purchased and installed QuickTime MPEG2. I can view the .VOB files, but there is no music and I can't make it run as a complete video.This is normal also. The QT MPEG-2 Component only supports the video portion of the VOB's MPEG-2 audio/video stream. While your Mac will now support MPEG2/MP2 (.mpeg) playback, your DVD likely contains an AC3 audio data which is not QT supported at all in "muxed" compression formats and only partially supported in "frame-to-frame" compression formats when a third-party component is installed.
I was just hoping to be able to have it stored on my Mac and be able to view it. Is there a simple way to accomplish this?You have three basic options here:
1) Since you have already copied the VIDEO_TS folder to your hard drive, you could try opening the Apple DVD Player, use the "Open DVD Media" File command to navigate to/select the VIDEO_TS folder. Then press the controller "Play" button to see if the content plays normally. (Since files are copied using handshaking error correction and data rereads, you may have a good playable copy of you disc saved already.
2) Since you can view the video in QT, I assume all you need to do is use an MPEG based third-party application to regain the audio. As you already have the QT MPEG-2 component installed, my preference would be MPEG Streamclip (free) here. You can use the "Convert to MPEG" File menu option to change your MPEG2/AC3 main title file to MPEG/MP2 (.mpeg) file which is playable on your Mac. This conversion is very fast since the video is not re-compressed. Alternatively, you can convert the main title to a more efficient codec which is compatible with your Mac and takes up less space. Unfortunately, this requires re-compression which may take much longer to accomplish. In either case, be sure to use the "Fix Timecode Breaks" option before performing either type of conversion.
3) Lastly, you can use an alternate media player like MPEG Streamclip or VLC for playback. Both will play the VOB AC3 audio, but only VLC has "device encoded" output support to an external decoder/powered speakers if your computer is equipped with such hardware. -
Whether there is a simple way to add new Mapping operators on a mapping?
Whether there is a simple way to add new Mapping operators on existing mapping?
For example I have a mapping, but now I need to add new Filter or Aggregator operator, so I must delete all connections between attributes, then add new operator, connect source attributes to the input attribute for the operator and so on.
Is there way to turn down this operations, simply drop new operator on source object or on a connection between two objects, and necessary operations will be automatically executed.
As I remember in OWB2 something similar existed in a way to add new Filter operator.Dmitry,
Unfortunately there is not. What you should aim for, is to use the group-by-group mapping using match by name (with some additional options, such as ignore source/target prefix, suffix, etc.).
I.e. if you want to insert another operator, then I recommend you first populate attributes based on an operator that is currently on the mapping delete the old operator (to delete all connections), map into the new operator and add another operator in order to re-create what you previously had. I know it is not ideal... but in my experience it is the most productive way to work.
Thanks,
Mark. -
Does OS 10.5x offer a simple way to create an alternating-text screensaver?
I'd like to create a screensaver from quotations I like and have them scroll across the screen--like Apple's built-in "Word of the Day" screensaver (though I'd like to have a "slow-scroll only" option; Apple's words sometimes whizz across the screen too fast for me).
Anyone have a simple way to do this for someone who still can't figure out what Apple Script is? Thanks for any suggestions!V.K.: Hm, then I guess it's a good thing I don't know what Apple Script is.
Seriously, it's too bad Apple doesn't give us some way to do this. I'm pretty sure I was able to do it ten years ago on my very first Macbook, and that was only OS 7x.
Anyone out there know of third-party text-writing screensaver software? -
I am going to buy a macbook pro for grade 12, and I need to know wheather I should get a macbook pro or a macbook pro retina. If someone could tell me (in a very simple way) which one is,better for me and why, I would be ever so apprreciative.
Why do you need a expensive MacBook Pro?
Your attending high school and unless everyone else is rich also your likely going to be a target by the more poorer students for theft or damage to the machine.
You could keep it home, but if you need it for class then your exposed again.
Also at that age your not very careful yet, a MacBook Pro is a expensive and easily damaged machine.
Unless your made of money and so are others at your school, I would recommned a low profile, just does the job cheap Windows PC.
If it dies, gets lost, stolen or damaged because of your inexperince handling senstivie electronics then it's no big deal.
You can buy a Mac later on when your sure you have a need for it, currently there isn't much advantage of owning a Mac compared to a PC, they do just about the same things now, one just looks prettier than the other.
Since 95% of the world uses Windows PC's your going to have to install Windows on the Mac in order to keep your skills up there or be unemployed, so it's a extra headache and expense.
good luck -
I have two apple accounts and one of which has my music on. I would like to move this music to the other account. Is there a simple way of doing this?
There is currently no way to merge accounts. The best option is to pick one, and use it consistantly.
HTH. -
Best way to share files between computers?
Hi,
I have a MBP & a G5 and I am doing video editing with FCP & web-designing with
Dreamweaver on both of the computers. The problem is that I have been using
the two computers completely separate.
For example, if I create a project on my laptop, I can't go to my desktop and continue it
unless I copy the files to a zip drive (or something similar) and manually transfer the files.
And then I don't know which files are actually up to date.
Is there any simple way that I can have the two computers produce, access & share files easier?
I do have a .mac account but I don't know much about it's capabilities?
I could really use some help and advise here.
Thanx,
ToddHi,
I had the exact same question/ problem a couple of days ago. I think in your case, working with large video files, .mac might not be an option.
I would say you either work of an external drive (maybe connected as a shared drive wirelessly) as it was suggested to me, or you use a file sync utility like ChronoSync to keep both machines mirrored.
Hope this helps. -
I just got new ipad mini....I want to delete all of the music that was synced from my itunes account. I have went through and deleted some songs one by one but some have a cloud icon with a red arrow on them.....is there a simple way just to delete them?
Yes there is. Those songs are not actually on your iPad. They are in iCloud ready for download if you choose to do so. If you want to remove them go to Settings>iTunes & App Store>Show All>Music>Off. You can also do this in Settings>Music>Show All Music>Off.
Maybe you are looking for
-
Want to move iPhoto Library to other disk
I have iPhoto 2.0.1, and my mac is pretty old. The main HD is 10G, and I'm out of space. I have mounted an external HD with plenty of space, where I've already moved my iTunes library, and want to do the same with the iPhoto library. Can I do this wi
-
How do I change the default font In Pages 08
When I open a new blank document the Font is Helvica. I want Verdana to be the default. This seems like a dumb question, but I can't see any way to do it. Thanks for any help. Owen
-
Hi all, In our customizing report, client needs to shown in the report payment terms wise, not on total billing doc amount. for this which table i need to use? can anybody help me in this regard? Raghav
-
NW 7.3 and roles from backend instances
Hi I'm trying to find out more information about roles from backend instances in NW 7.3. In particular how the roles are synchronised with changes that may occur to the roles in the backend (ie role changes or users allocated to the role). I haven't
-
I can't transfer from a legaly puchased music cd to itune because it is wma protected. help
I recently purchased a ipoud touch, installed itune on my window 7 pc and transfert all my old window média library to itune. Everything work ok except somes music files won't transfert because they are wma protected. Theses files comes from a legaly