Monday, August 22, 2011

Roll up account balance JD Edwards

drop

table #temp

select

gbobj,gbsub,gmdl01,gmlda,sum(gbapyc/100)gbapyc,sum(gban01/100)gban01,sum(gban02/100)gban02,sum(gban03/100)gban03,

sum

(gban04/100)gban04,sum(gban05/100)gban05,sum(gban06/100)gban06,sum(gban07/100)gban07,

sum

(gban08/100)gban08,sum(gban09/100)gban09,sum(gban10/100)gban10,sum(gban11/100)gban11,sum(gban12/100)gban12

into

#temp

from

jde_crp.crpdta.f0902

left

outer join jde_crp.crpdta.f0901 on gbaid=gmaid

where

gmco=1 and gmobj>=40000

and

(gban01+gban02+gban03+gban04+gban05+gban06+gban07+gban08+gban09+gban10+gban11+gban12)<>0

group

by gbobj,gbsub,gmlda,gmdl01

order

by gbobj,gbsub,gmlda

drop

table [#temp2]

select

distinct gmobj,gmsub,gmdl01,gmlda into #temp2 from jde_crp.crpdta.f0901 where gmco=1 and gmobj>=40000

drop

table [#temp3]

select

a.gmobj pgmobj,a.gmsub pgmsub,a.gmdl01 pgmdl01,a.gmlda pgmlda, b.*

into

#temp3 from #temp2 a

left

outer join #temp b on gbobj=gmobj and gbsub=gmsub

order

by a.gmobj

delete

from #temp3 where gbobj is null and pgmlda in(7,8)

drop

table #temp4

select

ltrim

(substring(a.gmobj,1,1)+'0000')t01,d.gmdl01 td01,

ltrim

(substring(a.gmobj,1,2)+'000')t02,c.gmdl01 td02,

ltrim

(substring(a.gmobj,1,3)+'00') t03,b.gmdl01 td03,

a

.* into #temp4

from

#temp2 b

left

outer join #temp2 a on ltrim(substring(a.gmobj,1,3)+'00')=b.gmobj

left

outer join #temp2 c on ltrim(substring(a.gmobj,1,2)+'000')=c.gmobj

left

outer join #temp2 d on ltrim(substring(a.gmobj,1,1)+'0000')=d.gmobj

where

a.gmlda in(4,5,6,7)order by a.gmobj

--select * from #temp3

--select * from #temp4

select

t01

,td01,t02,td02,t03,td03,gmobj,gmsub,a.gmdl01,a.gmlda,gbobj,gbsub,gbapyc,gban01,

gban02

,gban03,gban04,gban05,gban06,gban07,gban08,gban09,gban10,gban11,gban12

from

#temp4 b

left

outer join #temp3 a on a.pgmobj=b.gmobj and a.pgmsub=b.gmsub

where

a.pgmobj is not null

Friday, August 19, 2011

Account hierarchy JD edwards - F0901

select

GMMCU,GMOBJ,GMSUB,GMLDA , GMPEC , GMDL01 from testdta.f0901

where

gmobj>40000

group

by GMLDA , GMPEC , GMDL01,GMMCU,GMOBJ,GMSUB

Thursday, August 18, 2011

Leading zero drop from CSV file - A solution

In JD Edwards Report we have this issue Leading zero drop from CSV file , you can get output without dropping leading zeros like following:-
 
Open Excel File=> Click on Data=>Double click on From Text =>Select text file SCIInvoice.csv=> click on Delimited=> Click Next=>Select Comma=>click on last column with leading zeros=>Select Text=> Click on Finish =>OK


 

Wednesday, August 17, 2011

Create Power form JD Edwards Sample

Power form JD Edwards Sample from Oracle site, complete steps:-
 
 
 
 
https://support.oracle.com/CSP/main/article?cmd=show&type=NOT&doctype=HOWTO&id=1320607.1&addClickInfo=<data search_text="power%20forms%20subforms%20%20" search_result_size="18" search_result_count="18" powerview_id="" on_off="off" item_position_in_list="15"/>
 

 

Tuesday, August 16, 2011

conversion to black and white works webcam .net

The numbers below the image are delays in milliseconds measured on my 2.8GHz PC with the webcam set to 640x480 pixels. The milliseconds show some interesting results. For example, the slowest step is the webcam image gathering. 100 ms means that you will get 10 frames per second. This is poor. Webcams are typically slow. You can make them faster on account of quality. A lower resolution makes the camera faster, but the image quality may become useless. Another surprise is why the conversion to black and white is so slow (12ms). On the other hand, what is expected to be slow is OCR and the solver. But those are surprisingly fast – only 7 ms. I will explain each step in detail and show how things could be improved. The source code function that invokes the above process is DoSomeImageProcessing().
 
 
http://www.codeproject.com/KB/game/WebcamSudokuSolver.aspx
 
 

Wednesday, August 10, 2011

Rotate desktop Screen

How  to fix Rotated desktop Screen:-
 
You can use ctl+alt+up/down/left/right


Radiobutton text vale in code behind c#

for (int i = 0; i < GridView1.Rows.Count; i++)

{

GridViewRow row = GridView1.Rows[i];

orgqstno = ((

Label)GridView1.Rows[i].FindControl("Label2")).Text;

// Response.Write(((RadioButton)row.FindControl("MyRadioButton3")).Text+"<br>");

//orgqs

if (((RadioButton)row.FindControl("MyRadioButton3")).Text =="")

{

((

RadioButton)row.FindControl("MyRadioButton3")).Visible = false;

((

RadioButton)row.FindControl("MyRadioButton4")).Visible = false;

}

}

Sunday, August 7, 2011

Convert ToDecimal 2 places decimal C#

 
decimal rstval = Convert.ToDecimal(cortans) / Convert.ToDecimal(totrec) * 100;
 string rstvalfl = rstval.ToString("#.##");

Friday, August 5, 2011

OPENROWSET xlsx sql-server data transfer to excel

tested code for  OPENROWSET xlsx sql-server data transfer to excel as following:-
 
 
SELECT
* FROM OPENROWSET('MSDASQL','DRIVER=Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb);

UID=admin;UserCommitSync=Yes;Threads=3;SafeTransactions=0;ReadOnly=1;PageTimeout=5;MaxScanRows=8;

MaxBufferSize=2048;FIL=excel 12.0;DriverId=1046;DefaultDir=c:/;DBQ=

c:\allprogram.xlsx'

, 'SELECT * FROM [Sheet1$]')
 
 
 

Monday, August 1, 2011

Drop Temp Table - Sql-server

How to drop Temp Table?


IF OBJECT_ID('tempdb..#Budtemp', 'U') IS NOT NULL
DROP TABLE #Budtemp

String or binary data would be truncated. Alter table SQL

Msg 8152, Level 16, State 4, Line 1
String or binary data would be truncated.
The statement has been terminated.

 

ALTER TABLE #Budtemp 
ALTER COLUMN gbobj VARCHAR(10) NOT NULL