cmd.CommandText = "SELECT distinct GLMAST.fglhead,MAINFILE.facno,max(MAINTRAN.fdate) as fdate ,max(MAINTRAN.fbalance) as fbalance FROM MAINTRAN INNER JOIN MAINFILE ON MAINFILE.facno like MAINTRAN.facno INNER JOIN MASTERID ON MAINFILE.fmasterno like MASTERID.fmasterid INNER JOIN GLMAST ON GLMAST.fglcode like LEFT(MAINFILE.facno,9) and GLMAST.fglhead = '" & ComboBox2.Text & "' and MAINTRAN.fdate<='" & Format(prdate, "MM/dd/yyyy") & "' " & _ "where MAINTRAN.fbankcode='" & "010" & "'" & _ "and MAINTRAN.fdate<='" & Format(prdate, "MM/dd/yyyy") & "' " & _ "and MAINTRAN.fbranchcode='" & "01" & "' group by MAINFILE.facno,GLMAST.fglhead "
With cmd
dr = .ExecuteReader
End With
If dr.HasRows = True Then
Do While dr.Read
presentdaybal = dr!fbalance
Loop
dr.Close()
Guest UserPosted Nov 27, 2014, 4:19 AM
laxmikant joshiPosted Nov 27, 2014, 2:48 AM
Guest UserPosted Nov 27, 2014, 2:33 AM