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

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Analysis Server and Reporting Services (2008)
 Selecting certain digits from an integer
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Starting Member

8 Posts

Posted - 09/26/2013 :  18:47:06  Show Profile  Reply with Quote
I am building a report that will prompt for an integer skuNumber.

I would like to filter based on certain digits of this number.

For instance -

if 2nd digit of skuNumber is 3, display X
if 2nd digit of skuNumber is 4, display Y
if 2nd digit of skuNumber is 5, display Z

Can't figure out how to dissect the integer i.e. denote 2nd digit, 3rd digit and so on.



Starting Member

8 Posts

Posted - 10/03/2013 :  11:38:11  Show Profile  Reply with Quote
Go to Top of Page

Very Important crosS Applying yaK Herder

52326 Posts

Posted - 10/04/2013 :  04:52:55  Show Profile  Reply with Quote
use SubString() function

SQL Server MVP
Go to Top of Page

Flowing Fount of Yak Knowledge

United Kingdom
3385 Posts

Posted - 10/04/2013 :  05:32:52  Show Profile  Visit nigelrivett's Homepage  Reply with Quote
Do you know what size the integer is? Is it a fixed length?
Otherwise you need to convert to character format - will it be an issue if there is a 0 as the first character?

Cursors are useful if you don't know sql.
SSIS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.02 seconds. Powered By: Snitz Forums 2000