Welcome to Scribd. Sign in or start your free trial to enjoy unlimited e-books, audiobooks & documents.Find out more
Download
Standard view
Full view
of .
Look up keyword
Like this
1Activity
0 of .
Results for:
No results containing your search query
P. 1
Function SQL Terbilang Rupiah, Dolar, Umur

Function SQL Terbilang Rupiah, Dolar, Umur

Ratings: (0)|Views: 36|Likes:
Function SQL Terbilang Rupiah, Dolar, Umur
Function SQL Terbilang Rupiah, Dolar, Umur

More info:

Categories:Types, School Work
Published by: Abdul Gani Putra Suratma on Jun 11, 2014
Copyright:Traditional Copyright: All rights reserved

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

04/08/2015

pdf

text

original

 
 
Welcome to SQL
Function
 terbilang (rupiah & dolar)
Function
 terbilang umur
Abdul Gani Putras
 
 
CREATE function [dbo].[terbilang] (@nilai bigint) RETURNS varchar(1024) AS BEGIN DECLARE @hasil varchar(1024),@x bigint DECLARE @angka TABLE ( kode int, ket varchar(20)) INSERT INTO @angka VALUES(0,'') INSERT INTO @angka VALUES(1,'Satu') INSERT INTO @angka VALUES(2,'Dua') INSERT INTO @angka VALUES(3,'Tiga') INSERT INTO @angka VALUES(4,'Empat') INSERT INTO @angka VALUES(5,'Lima') INSERT INTO @angka VALUES(6,'Enam') INSERT INTO @angka VALUES(7,'Tujuh') INSERT INTO @angka VALUES(8,'Delapan') INSERT INTO @angka VALUES(9,'Sembilan') INSERT INTO @angka VALUES(10,'Sepuluh') INSERT INTO @angka VALUES(11,'Sebelas') IF @nilai <12 SET @hasil = (SELECT ket FROM @angka WHERE kode=@nilai) ELSE IF @nilai <20 BEGIN SET @x = @nilai - 10 SET @hasil = (SELECT ket FROM @angka WHERE kode=@x) + ' Belas' END ELSE IF @nilai <100 BEGIN SET @x = @nilai / 10 SET @hasil = (SELECT ket FROM @angka WHERE kode=@x) + ' Puluh ' SET @x = @nilai % 10 SET @hasil = @hasil + (SELECT ket FROM @angka WHERE kode=@x) END ELSE IF @nilai <200 BEGIN SET @x = @nilai - 100 SET @hasil = 'Seratus ' + dbo.terbilang(@x) END ELSE IF @nilai <1000 BEGIN SET @x = @nilai / 100 SET @hasil = dbo.terbilang(@x) + ' Ratus ' SET @x = @nilai % 100 SET @hasil = @hasil + dbo.terbilang(@x) END ELSE IF @nilai <2000
 
 
BEGIN SET @x = @nilai - 1000 SET @hasil = 'Seribu ' + dbo.terbilang(@x) END ELSE IF @nilai <1000000 BEGIN SET @x = @nilai / 1000 SET @hasil = dbo.terbilang(@x) + ' Ribu ' SET @x = @nilai % 1000 SET @hasil = @hasil + dbo.terbilang(@x) END ELSE IF @nilai <1000000000 BEGIN SET @x = @nilai / 1000000 SET @hasil = dbo.terbilang(@x) + ' Juta ' SET @x = @nilai % 1000000 SET @hasil = @hasil + dbo.terbilang(@x) END ELSE IF @nilai <1000000000000 BEGIN SET @x = @nilai / 1000000000 SET @hasil = dbo.terbilang(@x) + ' Milyar ' SET @x = @nilai % 1000000000 SET @hasil = @hasil + dbo.terbilang(@x) END ELSE IF @nilai <1000000000000000 BEGIN SET @x = @nilai / 1000000000000 SET @hasil = dbo.terbilang(@x) + ' Trilyun ' SET @x = @nilai % 1000000000000 SET @hasil = @hasil + dbo.terbilang(@x) END ELSE SET @hasil = 'N/A' RETURN @hasil END

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->