IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Character field failed conversion in numeric field


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
swapnadeep.ganguly

Active User


Joined: 21 Mar 2007
Posts: 203
Location: India

PostPosted: Fri Sep 21, 2007 4:01 pm
Reply with quote

Hi,

When I am trying to extract rows from a table based on the DATE (VARDATE is the column name), I am getting an error in which it is giving the display as "

A character field failed conversion to numeric field

I am using the query:

SELECT * FROM <table name>
WHERE VARDATE IN ('12/1/2006')

Please help me out regarding the same.
Back to top
View user's profile Send private message
twissi

Active User


Joined: 01 Aug 2005
Posts: 105
Location: Somerset, NJ

PostPosted: Fri Sep 21, 2007 4:49 pm
Reply with quote

Swapadeep,

What's the type of VARDATE? Maybe it was a DECIMAL type field (of course with no date separators) which doesn't require quotes.

Cheers, T.
Back to top
View user's profile Send private message
stodolas

Active Member


Joined: 13 Jun 2007
Posts: 632
Location: Wisconsin

PostPosted: Fri Sep 21, 2007 5:34 pm
Reply with quote

Last I checked, DB2 date formats are 2006-12-01
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Fri Sep 21, 2007 5:51 pm
Reply with quote

stodolas wrote:
Last I checked, DB2 date formats are 2006-12-01

The default string version of a date is yyyy-mm-dd but DB2 will accept dates in other formats. Is the select * from actually a select into? If it is then the format of one of the host variables is incorrect.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Sep 21, 2007 6:09 pm
Reply with quote

Hello,

Did you post the entire query?

Is this query being run in a program, spufi, or somewhere else?

What sql return code did you get? If you post any and all diagnostic the system provided it may help.

If you copy/paste it is usually faster and more readable.
Back to top
View user's profile Send private message
twissi

Active User


Joined: 01 Aug 2005
Posts: 105
Location: Somerset, NJ

PostPosted: Fri Sep 21, 2007 6:57 pm
Reply with quote

Swapnadeep,

Use '-' (hyphen) as the date separatro and see it works..!
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Fri Sep 21, 2007 7:38 pm
Reply with quote

twissi wrote:
Swapnadeep,

Use '-' (hyphen) as the date separatro and see it works..!


If the date is formatted as yyyy-mm-dd then the '-' is the correct separator but for mm/dd/yyyy you have to use '/'.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Issues Converting From ZD to Signed N... DFSORT/ICETOOL 4
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts 10 byte RBA conversion DB2 2
No new posts 10 byte RBA conversion -non applicati... JCL & VSAM 1
No new posts DFHPI1008 JSON generation failed COBOL Programming 0
Search our Forums:

Back to Top