Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Convert value in column to integer value

Author  Topic 

Mahavirjadhav
Starting Member

18 Posts

Posted - 2012-04-04 : 01:28:44
Hi all,

We are storing data in hindi / marathi language in database.

We are storing age of child like '?' for 8 years
Now I want the details of childs age group wise.
Following is the query.


select ChildCode, ChildFirstName+' '+ChildMiddleName+' '+ChildLastName as childName, CASE ChildSTCNo WHEN N'' THEN '-' ELSE ChildSTCNo END as ChildSTCNo, B.EnumerationValue AS ChildGender from CLTYMaster cm inner join District_MST dm on
cm.ChildDistrict= dm.DistrictCode inner join EnumerationValue AS B ON cm.ChildGender = B.EnumerationValueID where
ChildAge between N'?' and N'?'


But it is giving wrong out put.

Please help me.

Thanks and Regards,
Mahavir jadhav.


Mahavir

sql-programmers
Posting Yak Master

190 Posts

Posted - 2012-04-04 : 05:16:56
We need more information. So Pls Can you give table structure with some example values (Insert Statement).

SQL Server Programmers and Consultants
http://www.sql-programmers.com/
Go to Top of Page

vaibhavktiwari83
Aged Yak Warrior

843 Posts

Posted - 2012-04-04 : 07:40:14
If '?' is assigned as 8 years then why are you using
ChildAge between N'?' and N'?' instead of ChildAge = '?'

Vaibhav T

If I cant go back, I want to go fast...
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-04-04 : 18:49:53
are ? parameter holders? where is above query used?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -