SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Returning Selective numbers


Returning Selective numbers

Author
Message
Neel 7777
Neel 7777
Valued Member
Valued Member (60 reputation)Valued Member (60 reputation)Valued Member (60 reputation)Valued Member (60 reputation)Valued Member (60 reputation)Valued Member (60 reputation)Valued Member (60 reputation)Valued Member (60 reputation)

Group: General Forum Members
Points: 60 Visits: 84
Can anybody help me to return the actcode where last three digit don't contain 000 (three zero)

SELECT COMCOD, ACTCODE, ACTDESC
FROM ACINF
WHERE (ACTCODE NOT IN
(SELECT ACTCODE FROM ACTRNA)) AND (COMCOD = 3309)

Returns :--

COMCOD ACTCODE ACTDESC

3309 10000000000 DIRECT MATRIALS
3309 10100000000 DIRECT MATERIALS
3309 10200000000 M.S. ROD
3309 10200100000 M.S.ROD X-TREAM
3309 10200101000 M.S.ROD X-TREAM 500
3309 10200200000 M.S.ROD 60 GRADE D/BAR
3309 10200201000 M.S.ROD 60 GRADE D/BAR
3309 10200201003 M.S.ROD 60 GRADE  12MM
3309 10200201004 M.S.ROD 60 GRADE  16MM
3309 10200201005 M.S.ROD 60 GRADE  20MM
3309 10200202000 M.S. ROD 40 GRADE
3309 10300000000 CEMENT
3309 10300100000 CEMENT
3309 10300101000 CEMENT (GREY)
3309 10300102000 CEMENT (WHITE)
3309 10300102001 CEMENT (WHITE)
3309 10400000000 SAND
3309 10400100000 SAND
3309 10400101000 FILLING SAND
3309 10400102000 MEDIUM SAND
3309 10400102001 MEDIUM SAND FM-1.2
ChrisM@Work
ChrisM@Work
SSCoach
SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)

Group: General Forum Members
Points: 16133 Visits: 19537
What datatype is actcode?

“Write the query the simplest way. If through testing it becomes clear that the performance is inadequate, consider alternative query forms.” - Gail Shaw

For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
Exploring Recursive CTEs by Example Dwain Camps
Neel 7777
Neel 7777
Valued Member
Valued Member (60 reputation)Valued Member (60 reputation)Valued Member (60 reputation)Valued Member (60 reputation)Valued Member (60 reputation)Valued Member (60 reputation)Valued Member (60 reputation)Valued Member (60 reputation)

Group: General Forum Members
Points: 60 Visits: 84
nchar
ChrisM@Work
ChrisM@Work
SSCoach
SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)

Group: General Forum Members
Points: 16133 Visits: 19537
zahid_7777 (1/28/2013)
nchar


Thanks.

WHERE RIGHT(ACTCODE,3) <> '000'

“Write the query the simplest way. If through testing it becomes clear that the performance is inadequate, consider alternative query forms.” - Gail Shaw

For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
Exploring Recursive CTEs by Example Dwain Camps
Neel 7777
Neel 7777
Valued Member
Valued Member (60 reputation)Valued Member (60 reputation)Valued Member (60 reputation)Valued Member (60 reputation)Valued Member (60 reputation)Valued Member (60 reputation)Valued Member (60 reputation)Valued Member (60 reputation)

Group: General Forum Members
Points: 60 Visits: 84
Thank you very much I will try.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search