Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Returning Selective numbers Expand / Collapse
Author
Message
Posted Monday, January 28, 2013 1:43 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Thursday, August 1, 2013 12:41 AM
Points: 44, 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
Post #1412236
Posted Monday, January 28, 2013 1:45 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 4:44 AM
Points: 6,750, Visits: 13,893
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
Post #1412238
Posted Monday, January 28, 2013 4:22 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Thursday, August 1, 2013 12:41 AM
Points: 44, Visits: 84
nchar
Post #1412336
Posted Monday, January 28, 2013 5:20 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 4:44 AM
Points: 6,750, Visits: 13,893
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
Post #1412360
Posted Monday, January 28, 2013 8:39 PM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Thursday, August 1, 2013 12:41 AM
Points: 44, Visits: 84
Thank you very much I will try.
Post #1412736
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse