Date fields and compare and get the later date of the fields
I am trying to compare these date fields and compare and get the later date of the fields
Tables are
TABCASER
TABCASER1
EVCASERS
Field
Are
TABCASER1.CASER_no
The dates are to be compared and then get the records with the highest or latest date value.
TABCASER1.CASERRECIEVEDDATE
EVCASERS.FINALEVDATES
EVCASERS.PUBLICATIONDATE
EVCASERS.PUBLICATIONDATE
TABCASER.COMPAREACCEPDATE
I have this code but I am trying to figure out what it all means.
I have several questions.
1.
1. greatest it is used here to compare right? How do I then output this ? do I store it to a var (coldfusion) ultimately , I wish to send it to a page of records
2. is it necessary to use todate? And to_date? What does this do?
3. decode, is this necessary too. What does this do? NULL?
4.
5.
6. when I do get the query results how do I send it to coldsuion and out put to a display.
Someone sent me this code.
is there abetter way of doing this? To compare the dates and store in a var to display. thanks
Here is my code below:
Greatest(
CASE
WHEN INSTR(TABCASER1.CASER_no,'-CE') > 0 THEN
decode(TABCASER1.CASERRECIEVEDDATE,NULL,TO_DATE('01/01/1900','mm/dd/yyyy'),TABCASER1.CASERRECIEVEDDATE)
WHEN INSTR(TABCASER1.CASER_no,'-ERNIE') > 0 THEN
decode(EVCASERS.FINALEVDATES,NULL,TO_DATE('01/01/1900','mm/dd/yyyy'),EVCASERS.FINALEVDATES)
WHEN INSTR(TABCASER1.CASER_no,'-MONIE') > 0 THEN
decode(EVCASERS.PUBLICATIONDATE,NULL,TO_DATE('01/01/1900','mm/dd/yyyy'),EVCASERS.PUBLICATIONDATE)
WHEN INSTR(TABCASER1.CASER_no,'-NADINE') > 0 THEN
decode(EVCASERS.PUBLICATIONDATE,NULL,TO_DATE('01/01/1900','mm/dd/yyyy'),EVCASERS.PUBLICATIONDATE)
ELSE
decode(TABCASER.COMPAREACCEPDATE,NULL,TO_DATE('01/01/1900','mm/dd/yyyy'),TABCASER.COMPAREACCEPDATE)
END
,decode(TABCASER.COMPAREACCEPDATE,NULL,TO_DATE('01/01/1900','mm/dd/yyyy'),TABCASER.COMPAREACCEPDATE))
between TO_DATE('#dateformat(form.startDate,"mm/dd/yyyy")#','MM/DD/YYYY') and TO_DATE('#dateformat(form.endDate,"mm/dd/yyyy")#','MM/DD/YYYY')
is there abetter way of doing this? To compare the dates and store in a var to display. thanks
Hi
If you have date datatypes than:
select
greatest(TABCASER1.CASERRECIEVEDDATE, EVCASERS.FINALEVDATES, EVCASERS.PUBLICATIONDATE, EVCASERS.PUBLICATIONDATE, TABCASER.COMPAREACCEPDATE)
from TABCASER, TABCASER1, EVCASERS
where ...-- join and other conditions
1. greatest is good enough
2. to_date creates date dataype from string with the format of format string ('mm/dd/yyyy')
3. decode(a, b, c, d) is a function: if a = b than return c else d. NULL means that there is no data in the cell of the table.
6. to format the date for display use to_char function with format modell as in the to_date function.
Ott Karesz
http://www.trendo-kft.hu
Similar Messages
-
how do i get backed up purchases from an old iphone to a new one, but the only problem is an ipod is backed up into the new phone and i cant get my iphone data on to the new phone because its under i pod?
Thanks very much!
Although I had to add everything again to the playlist, at least I can just copy it over in future! -
I have problem with my iphone as it is disable and need to get all my data as the phone needs at least 40 years to enable accessing it
If you have never connected the phone to iTunes and backed it up or used iCloud to backup your data, it is lost at this point.
The only way to get back into the phone is to restore it.
~Lyssa -
I don't have a update software in my general settings G3 phone and can't get past up date 4.2.1 using itunes all I want is to download the free skype app
iOS 4.2.1 is the latest for the iPhone 3G.
-
I have an app in my app store that is requiring an update but I never purchased the app and when I click update, another apple ID pops up that is not mine. Now i keep getting reminders to update the app and I cant get rid of it from the app store. Help.
You installed a hacked app, originally from the Mac App Store. It contains the receipt for a different app, downloaded using an account that you don't control. You need to identify and remove the hacked app.
Important: The app you need to remove is not necessarily the one named in the App Store notice. For example, if the App Store says you need to update "Twitter," the hacked app may be "Angry Birds" or something else entirely. Don't make any assumptions about which app you're looking for. To find it, you have to carry out a systematic search.
Triple-click anywhere in the line of text below on this page to select it:
kMDItemAppStoreHasReceipt=1
Copy the selected text to the Clipboard (command-C).
In the Finder, press the key combination command-F to open a search window, or select
File ▹ Find
from the menu bar. In the search window, select
Search: This Mac
from the row of tokens below the toolbar. Below that is a popup menu initially showing Kind. From that menu, select Other...
A sheet will drop down. In that sheet, select Raw Query and click OK or press return.
Now there will be a text box to the right of popup menu. Click in that box and paste (command-V).
The search window will show all the App Store products you've installed. Compare those search results with the list of your purchases from the App Store. To see the complete list, you may need to unhide hidden purchases. If any apps were download from the App Store using other Apple ID accounts that you control, sign in to the store under each of those ID's and check the purchases.
At least one of the items listed in the search window is not among your purchases in the App Store. Move each such item to the Trash. You may be prompted for your administrator password. Empty the Trash.
Log out and log back in. Test. -
Is there a way to get a version of the Garage Band app that runs on version 5.1.1? I have an iPad 1 and can't get any higher iOS. The App store is telling me that Garage Band only runs on iOS 7.
Unfortunately the answer is still no.
-
my hard drive crashed on my MacBook Pro crashed and I need to get my CS5 up and running on the new hard drive. I copied what I could onto an external hard drive but when I drag and drop I get directions to uninstall but the uninstall folder I have does says it is an alias that is no longer present. I get error 6. I would like to get my software up and running on the laptop again please
If you subscribed to iTunes match the songs are kept in icloud. If you didn't but you did save the actual iTunes library folder which should include the music, video, etc. you should be able to just drag this file back to your machine in the same place and when you open iTunes it will give you a chance to identify the iTunes library folder.
You can test this to find out if you saved the media files or not and don't need to attach your nano to do it.
You are correct that once you connect the nano it will clear the existing files from it and sync it with the new iTunes library.
If you don't have the media files i'm not sure if/how to get them back on a windows ipod. I have everything backed up regularly because of the horror stories I have seen & heard. -
How do you change the name of a reminder in the reminder list. I right click and then choose "get information" I can change the colour of the reminder but when I type in the name that I want and then press enter the name stays as "untitled"
Jerry,
Thanks for replying again. I've got a little bit further thanks to you. I tried the US keyboard layout as you seemed pretty definte that it should work. This time I applied the setting and also started the language toolbar and selected it from there.
Hey presto, I've got the @ where it should be. Excellent.
However the single quote ' works in a weird way. When I press it, it doesn't show up on the screen. But when I press another key, I get the single quote plus the next key I press. When I press the single quote twice, I get 2 of them. This is also the same with the SHIFT ' key. i.e. for the double quotes.
Very strange. I'll look at other keyboards and see where that gets me.
Thanks, Maz -
When I left my former employer, Pollinate Agency, I bought a MacBook Pro with Acrobat Pro (version 9 or possibly 9.5) installed from the company. I recently had a serious computer crash, and needed to get all contents erased. The support provider didn't have my product key, so could not reinstall Acrobat Pro for me. Since then, I have gotten the product key sent to me from my former employer, [ REMOVED ] So I need help in re-downloading, installing and activating the Acrobat Pro software on this computer.
Please remove the S/N immediately (I can't or would). Never post them online. As for download you can go to http://helpx.adobe.com/acrobat/kb/acrobat-downloads.html on the right panel to get 9 pro. I am not sure there is a MAC version there, but that is the first place to go. If it is the proper version, then please back it up to CD and/or portable HD, not the system HD.
-
When i pick my brush tool and try to get a soft brush from the drop down menu they all look white, i don't see a soft brush from a non soft brush.How can i fix this issue in photoshop? Thanks
Hi tvilela,
Do you, by chance, have the Pencil Tool selected in place of the Brush Tool.
-Noel -
After Photoshop Elements quit working for the second time in three months, I uninstalled it and now cannot get it to reinstall from the disc. Nothing happens when I insert the disc. All I can do is look at the folders and files and see nothing that tells me how to start the installation. Clicking "open with Auto play" gives me irrelevant options, view photos, share, etc. I'm running Windows 8. This program has worked, although buggy, for the past year.
reinstall by clicking setup on your disk or downloading and installing,
Downloads available:
Suites and Programs: CC | CS6 | CS5.5 | CS5 | CS4 | CS3
Acrobat: XI, X | 9,8 | 9 standard
Premiere Elements: 12 | 11, 10 | 9, 8, 7
Photoshop Elements: 12 | 11, 10 | 9,8,7
Lightroom: 5 | 4 | 3
Captivate: 8 | 7 | 6 | 5
Contribute: CS5 | CS4, CS3
Download and installation help for Adobe links
Download and installation help for Prodesigntools links are listed on most linked pages. They are critical; especially steps 1, 2 and 3. If you click a link that does not have those steps listed, open a second window using the Lightroom 3 link to see those 'Important Instructions'. -
Hi…I am trying to email photos from iPhoto and I keep getting a flag that says "the server does not recognize the username/password combination. Can you help me to reset it?
Thank you very much for the quick reply and it was so easy. Make my life much easier now
Thanks so much -
Whenever I open my music and select a song, my iphone immediately scrolls through other songs rapidly and then I get a pop up saying "the requested url cannot be served" and I can never listen to music
I'm in the same boat...so far no one has helped here
-
What is the lates OS for the Curve 8320?
What is the lates OS for the Curve 8320?
Thanks, mimi
It is 4.6 for my bb pearl flip
I just got my curve yesterday and it is 4.5?
Should it be 4.6 also?
Thanks again...
Solved!
Go to Solution.No, 4.6 is not an OS for the 8320.
The latest OS for the 8320 is 4.5.0.124
http://www.blackberryforums.com/general-8300-series-discussion-curve/170512-latest-os-8320-4-5-0-174...
1. If any post helps you please click the below the post(s) that helped you.
2. Please resolve your thread by marking the post "Solution?" which solved it for you!
3. Install free BlackBerry Protect today for backups of contacts and data.
4. Guide to Unlocking your BlackBerry & Unlock Codes
Join our BBM Channels (Beta)
BlackBerry Support Forums Channel
PIN: C0001B7B4 Display/Scan Bar Code
Knowledge Base Updates
PIN: C0005A9AA Display/Scan Bar Code -
I have both Iwork and Microsft Office (had to have it for school) on my Macbook Pro. Can I uninstall Iwork on my computer and re install it at a later date from the disc, or was it a one time install
KBowman0526 wrote:
Can I uninstall Iwork on my computer and re install it at a later date from the disc
yes.
Maybe you are looking for
-
Target flat file with pipe seperated
Hi I want to load the data in flat file , i don't see pipe "|" seperation values to create a flat file in this format. how can i achive and how can i also how can i create file name dynamically Thanks
-
Including external Javascript file in JSP- not working on Mozilla Firefox
I have a JSP page which includes javascript file as below: <script type="text/javascript" src="https://siteAddress/scripts/myJsFile.js"></script> myJsFile.js has a method testFireFox() There is a link on JSP which that calls this method. <a href="#"
-
How to choose which Aperture duplicate photo to keep
I use Aperture 3.4.5 on an iMac with OS 10.8.4 and, like many others who have written to this community, I have acquired lots of duplicates because some years ago I moved from iPhoto to Aperture. Those collections are mostly referenced in their orig
-
Add fields in VL10 report - EHN
Hi , I am supposed to add two fields from Table KNVV-KVGR1/KVGR2 table in to alv report output of VL10/VL10A. I have tried for BADI but none got trigged. Is.Is the any Badi/Exits available or do I need to go for explict/implicit enhancement. Kindly h
-
Hi. I'd appreciate any help people can offer regarding this problem. I am creating some animations using Flash 8. Some work just fine. Others give me the following message when I try to add a new movie clip: One or more library items exists in docume