473,513 Members | 2,545 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

No one can answer this question

2 New Member
How to convert 'Apr 19 20:00:03 CDT 2009' text to date using db2 functions
May 19 '09 #1
2 2174
vkesavdba
1 New Member
Did you solved mystery?

http://www.ibm.com/developerworks/db.../0211yip3.html

check this it may help
Jun 10 '09 #2
Kozy
10 New Member
Or just write a simpl function... exampl of sql ( might have done something wrong in the month names, so check that, jan, feb, mar ... dec ), other then that this should work.

Expand|Select|Wrap|Line Numbers
  1. SELECT 
  2. TRIM(SUBSTR(T1.DATE_CONVERT,LOCATE(' ',T1.DATE_CONVERT),LOCATE(' ',SUBSTR(T1.DATE_CONVERT,LOCATE(' ',T1.DATE_CONVERT)))+2))||'.'||CASE WHEN SUBSTR(T1.DATE_CONVERT,1,3) = 'JAN' THEN '1' WHEN SUBSTR(T1.DATE_CONVERT,1,3) = 'FEB' THEN '2' WHEN SUBSTR(T1.DATE_CONVERT,1,3) = 'MAR' THEN '3' WHEN SUBSTR(T1.DATE_CONVERT,1,3) = 'APR' THEN '4' WHEN SUBSTR(T1.DATE_CONVERT,1,3) = 'MAY' THEN '5' WHEN SUBSTR(T1.DATE_CONVERT,1,3) = 'JUN' THEN '6' WHEN SUBSTR(T1.DATE_CONVERT,1,3) = 'JUL' THEN '7' WHEN SUBSTR(T1.DATE_CONVERT,1,3) = 'AUG' THEN '8' WHEN SUBSTR(T1.DATE_CONVERT,1,3) = 'SEP' THEN '9' WHEN SUBSTR(T1.DATE_CONVERT,1,3) = 'OKT' THEN '10' WHEN SUBSTR(T1.DATE_CONVERT,1,3) = 'NOV' THEN '11' WHEN SUBSTR(T1.DATE_CONVERT,1,3) = 'DEC' THEN '12' ELSE '1' END||'.'||TRIM(SUBSTR(T1.DATE_CONVERT,LENGTH(T1.DATE_CONVERT)-3,4)) 
  3. FROM (SELECT UPPER('MAY 1 20:00:03 CDT 2009') AS DATE_CONVERT FROM SYSIBM.SYSDUMMY1) 
  4. AS T1
  5.  
Jun 11 '09 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
5182
by: Mohammed Mazid | last post by:
Hi folks! Can anyone please help me with this? I am developing a Quiz program but I am stuck with "multiple answers". Basically I need some sort of code that would select multiple answers using check boxes. For example, a question such as
4
3591
by: Mohammed Mazid | last post by:
Hi folks! Can anyone please help me with this? I am developing a Quiz program but I am stuck with "multiple answers". Basically I need some sort of code that would select multiple answers using check boxes. For example, a question such as
9
3735
by: Dave H | last post by:
Hello, I have a query regarding definition lists. Is it good practice semantically to use the dt and dd elements to mark up questions and answers in a frequently asked questions list, or FAQ? Here is an example of just such a usage: <dl class="faq"> <di>
4
3022
by: Nigel Molesworth | last post by:
I've Googled, but can't find what I need, perhaps I asking the wrong question! I want a "FAQ" page on a web site, I hate those pages that scroll you to the answer so and I figured that a good way to do it would be to have hidden content under each question, something like this : What is the first letter of the alphabet?
2
1960
by: amelia170 | last post by:
I am creating a database with a yes or no answer for question 1. Based on that answer, (if they answer yes) they will answer question 2, then three....However, if they answer no to question one, I want them not to be able to answer question 2 at all. Ideas? Thanks so much!
32
9399
by: Michael C | last post by:
I want to inherit from Bitmap to add a property but I can't because it's sealed. Is there any reason to seal a class? Thanks, Michael
0
832
by: Ryan | last post by:
Although I would like my application to require Question and Answer, I plan to allow a central administrator to create accounts and then require users to setup their Question/Answer the first time they login. Therefore, I was wondering: Is it possible to set the New User wizard control to permit a blank Question/Answer WITHOUT turning off...
2
6835
by: Jonathan Wood | last post by:
In my application, new accounts must be created by an administrator--users will not create their own. Ideally, the user could then log on and specify their own password question and answer, and the administrator doesn't even know what that question and answer is. I thought I could do this since Membership.CreateUser() includes an overload...
2
7646
by: Ken Fine | last post by:
I want to add the security question and answer security feature to the ChangePassword control. I am aware that this functionality is built into the PasswordRecovery tool. I have implemented the PasswordRecovery with a Password reset required; a temporary password is sent to the account on file. I want an extra layer of security to accommodate...
0
7270
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7178
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7397
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7565
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7128
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
5704
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3255
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3242
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
817
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.