473,587 Members | 2,447 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 2178
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
5187
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
3594
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
3740
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
3029
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
1967
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
9427
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
834
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 the requirement in the web.config file. Also, if I added the QUESTION and ANSWER boxes to the...
2
6844
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 that does not include question and answer arguments. However, when I use it, I get the error...
2
7653
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 the very unlikely contingency that someone's e-mail account is compromised. Challenging with the...
0
8219
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
7978
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
8221
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
5722
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5395
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3845
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
3882
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2364
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1455
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.