SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

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

JGaston
Starting Member

USA
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.

Thanks!!!

J

JGaston
Starting Member

USA
8 Posts

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

visakh16
Very Important crosS Applying yaK Herder

India
52317 Posts

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

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

nigelrivett
Flowing Fount of Yak Knowledge

United Kingdom
3383 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  
 New 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.09 seconds. Powered By: Snitz Forums 2000