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

QMF


IBM Mainframe Forums -> All Other Mainframe Topics
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
richie

New User


Joined: 11 Jun 2005
Posts: 24

PostPosted: Tue Aug 23, 2005 12:01 pm
Reply with quote

Hi,

I am writing this query to retrieve the records from a table.

item_id char (9)
item_typ char (2)

select * from table1 where item_typ = 'KC' and item_id between '017897600' and '018263784'

While retieving the data its not giving me the recs as per second condition on item_id ex it gives item_id 005513510 also in the fetched recs.

Please tell me what could be the problem.
does between work on char datatype or do i need to convert the item_id to numeic first?
thanks a lot!!
Back to top
View user's profile Send private message
Rupesh.Kothari

Member of the Month


Joined: 27 Apr 2005
Posts: 463

PostPosted: Tue Aug 23, 2005 12:17 pm
Reply with quote

Hi Richie,

Generally we use between for Numeric data.

Try to change item_id to numeric and execute your query. it will give you required results.


Regards
Rupesh
Back to top
View user's profile Send private message
richie

New User


Joined: 11 Jun 2005
Posts: 24

PostPosted: Tue Aug 23, 2005 12:28 pm
Reply with quote

Hi Rupesh,

Thanks for your reply.

Please tell me how do we convert char to Num as TO_NUM function is not working here.Please let me know i we ahve anyother fuction for character to numeric conversion.

Thanks,
richie
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 -> All Other Mainframe Topics

 


Search our Forums:

Back to Top