Recent PostsRecent Posts Popular TopicsPopular Topics
 Home Search Members Calendar Who's On

 Returning Selective numbers Rate Topic Display Mode Topic Options
Author
 Message
 Posted Monday, January 28, 2013 1:43 AM
 SSC 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, ACTDESCFROM ACINFWHERE (ACTCODE NOT IN (SELECT ACTCODE FROM ACTRNA)) AND (COMCOD = 3309)Returns :--COMCOD ACTCODE ACTDESC3309 10000000000 DIRECT MATRIALS3309 10100000000 DIRECT MATERIALS3309 10200000000 M.S. ROD3309 10200100000 M.S.ROD X-TREAM3309 10200101000 M.S.ROD X-TREAM 5003309 10200200000 M.S.ROD 60 GRADE D/BAR3309 10200201000 M.S.ROD 60 GRADE D/BAR3309 10200201003 M.S.ROD 60 GRADE  12MM3309 10200201004 M.S.ROD 60 GRADE  16MM3309 10200201005 M.S.ROD 60 GRADE  20MM3309 10200202000 M.S. ROD 40 GRADE3309 10300000000 CEMENT3309 10300100000 CEMENT3309 10300101000 CEMENT (GREY)3309 10300102000 CEMENT (WHITE)3309 10300102001 CEMENT (WHITE)3309 10400000000 SAND3309 10400100000 SAND3309 10400101000 FILLING SAND3309 10400102000 MEDIUM SAND3309 10400102001 MEDIUM SAND FM-1.2
Post #1412236
 Posted Monday, January 28, 2013 1:45 AM
 SSCrazy Eights Group: General Forum Members Last Login: 2 days ago @ 9:41 AM Points: 8,605, Visits: 18,775
 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 ShawFor 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 ModenExploring Recursive CTEs by Example Dwain Camps
Post #1412238
 Posted Monday, January 28, 2013 4:22 AM
 SSC 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
 SSCrazy Eights Group: General Forum Members Last Login: 2 days ago @ 9:41 AM Points: 8,605, Visits: 18,775
 zahid_7777 (1/28/2013)ncharThanks.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 ShawFor 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 ModenExploring Recursive CTEs by Example Dwain Camps
Post #1412360
 Posted Monday, January 28, 2013 8:39 PM
 SSC 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

 Permissions