Patabang ta ko sa mga master. bag-o pako sugod ug programming using vb6.
naa koy table named TABLE1 with field1(nvarchar) field2(float)
these are the records below:
field1
12-56
54-58
45-58
45-52
...and more
gusto nko i convert ang first 2 ug ang last 2 characters into numbers sa field1 ug ang resulta sa computation isulod nko sa field2
mao ni akong codes:
Private Sub cmdConvert_Click()
On Error Resume Next
a=datagrid1.columns("field1")
a1 = Val(Left(a, 2))
a2 = Val(Right(a, 2))
a3 = la1 + (a2 / 300)
OpenConn
Set rstemporary = OpenRst("UPDATE TABLE1 set field2='" & a3 & "'")
datConvert.Recordset.Update
datConvert.RecordSource = "select * from TABLE1"
datConvert.Refresh
Endsub
naay resulta pero ang masulod kay usa raman ka records sa field1
mangayo ko sa inyong tabang mga master1