TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
ahmed elbarbary
NA
1.6k
278.5k
How to separate field partdone to text yes or no or null bas
Mar 11 2020 3:26 AM
How to separate field partdone to text yes or no or null based on position ?
I work on SQL server 2012 and have table parts have two field
partId
int
PartDone nvarchar(50)
partId partDone
555444 0012
911877 0221
the length of partDone field is 4 numbers
I need to loop within partDone field
if 0 then no
if 1 then yes
if 2 then null
FinalResult
partId partDone
first
second
third four
555444 0012
no
no
yes
null
911877 0221
no
null
null
yes
this field partDone accept only 0 or 1 or 2
and I need to divide them to yes or no or null based on position of every number
What I have tried:
select partId,partDone from Parts
Reply
Answers (
3
)
There are fewer columns in the Insert statement than values?
CrystalReport to DataSource using SQL Client Native