Jump to content

DB2 - SQL help plz - Basic


Recommended Posts

Posted

       SELECT   CAST ( CAST ( '19470815' AS varchar(8)) as DATE )-- SQL server lo vastundhi data 

 

BUT DB2 lo enduku ravtledu.. CAST ( CAST rayalema??

 

na original requirement decimal (8) undhi so date ki convert cheyali.. direct date ki thesukovadam ledu anduke ela chestuna.. 

Posted

date length 10 characters kadha with dash or slashes

8 ani unchaav...is tht causing issue?

Posted
40 minutes ago, Sambadu said:

       SELECT   CAST ( CAST ( '19470815' AS varchar(8)) as DATE )-- SQL server lo vastundhi data 

 

BUT DB2 lo enduku ravtledu.. CAST ( CAST rayalema??

 

na original requirement decimal (8) undhi so date ki convert cheyali.. direct date ki thesukovadam ledu anduke ela chestuna.. 

nuvvu emi rasav??

 

error message ento veyyi

Posted

What version of DB2 are you working with Bro?

use to_date function

Select date(to_date(col_name,'DD-MM-YYYY HH:MI:SS')) from table

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...