|
database
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
decimal column to PIC9(09)V99We have to extract an amount column defined as decimal9(11,2) to a COBOL
defined PIC 9(09)V99...The "V" indicating an assumed decimal place. So, 100.00 needs to be extracted as 10000. Can someone help me with this??? Thanks in advance for your help. wnfisba Why not just ultiply the column by 100?
Roy Harvey Beacon Falls, CT On Thu, 3 Aug 2006 15:53:01 -0700, wnfisba <wnfi***@discussions.microsoft.com> wrote: Show quote >We have to extract an amount column defined as decimal9(11,2) to a COBOL >defined PIC 9(09)V99...The "V" indicating an assumed decimal place. So, >100.00 needs to be extracted as 10000. > >Can someone help me with this??? > >Thanks in advance for your help. > >wnfisba Here are a couple of options:
DECLARE @TestNumber decimal(11,2) SET @TestNumber = 12345.67 SELECT cast(( @TestNumber * 100 ) AS int ) , replace( cast( @TestNumber AS varchar(12)), '.', '' ) -- Show quoteArnie Rowland, Ph.D. Westwood Consulting, Inc Most good judgment comes from experience. Most experience comes from bad judgment. - Anonymous "wnfisba" <wnfi***@discussions.microsoft.com> wrote in message news:1803003F-95FF-4A41-B0E3-411D10E3934C@microsoft.com... > We have to extract an amount column defined as decimal9(11,2) to a COBOL > defined PIC 9(09)V99...The "V" indicating an assumed decimal place. So, > 100.00 needs to be extracted as 10000. > > Can someone help me with this??? > > Thanks in advance for your help. > > wnfisba |
|||||||||||||||||||||||