Find no. of currency note & coins (Tip)
Posted: Sun May 07, 2006 2:57 pm
I was make this query for help some one.......
SELECT Sal,TRUNC(Sal/1000) "1000", TRUNC(MOD(Sal,1000)/500) "500",
TRUNC(MOD(MOD(Sal,1000),500)/100) "100", TRUNC(MOD(MOD(MOD(Sal,1000),500),100)/50) "50",
TRUNC(MOD(MOD(MOD(MOD(Sal,1000),500),100),50)/20) "20",
TRUNC(MOD(MOD(MOD(MOD(MOD(Sal,1000),500),100),50),20)/10) "10",
TRUNC(MOD(MOD(MOD(MOD(MOD(MOD(Sal,1000),500),100),50),20),10)/5) "5",
TRUNC(MOD(MOD(MOD(MOD(MOD(MOD(MOD(Sal,1000),500),100),50),20),10),5)/2) "2",
TRUNC(MOD(MOD(MOD(MOD(MOD(MOD(MOD(MOD(Sal,1000),500),100),50),20),10),5),2)/1) "1"
FROM emp;
I have also developed a sample report using oracle reports 6i for this and you can download it.
[img]/images/icon_zip.gif[/img] <b>Attachment:</b> coinage.zip <i>( 10654bytes )</i>
if there is any other way please reply in this thread
Best regards,
R E H A N M I R Z A
System Analyst / Senior Oracle Developer
+92-304-2120807
When ever you pray
Please remember me and my family
SELECT Sal,TRUNC(Sal/1000) "1000", TRUNC(MOD(Sal,1000)/500) "500",
TRUNC(MOD(MOD(Sal,1000),500)/100) "100", TRUNC(MOD(MOD(MOD(Sal,1000),500),100)/50) "50",
TRUNC(MOD(MOD(MOD(MOD(Sal,1000),500),100),50)/20) "20",
TRUNC(MOD(MOD(MOD(MOD(MOD(Sal,1000),500),100),50),20)/10) "10",
TRUNC(MOD(MOD(MOD(MOD(MOD(MOD(Sal,1000),500),100),50),20),10)/5) "5",
TRUNC(MOD(MOD(MOD(MOD(MOD(MOD(MOD(Sal,1000),500),100),50),20),10),5)/2) "2",
TRUNC(MOD(MOD(MOD(MOD(MOD(MOD(MOD(MOD(Sal,1000),500),100),50),20),10),5),2)/1) "1"
FROM emp;
I have also developed a sample report using oracle reports 6i for this and you can download it.
[img]/images/icon_zip.gif[/img] <b>Attachment:</b> coinage.zip <i>( 10654bytes )</i>
if there is any other way please reply in this thread
Best regards,
R E H A N M I R Z A
System Analyst / Senior Oracle Developer
+92-304-2120807
When ever you pray
Please remember me and my family