Convert Assosiative Array to Numeric Array
Tampilkan postingan dengan label sql. Tampilkan semua postingan
Tampilkan postingan dengan label sql. Tampilkan semua postingan
Jumat, 20 Januari 2017
Senin, 22 Agustus 2016
OLEDB acces vb.net
Dim cnn As New _
OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
this.appDir & "\data\keuangan.mdb;Jet OLEDB:Database Password=ppp;")
' OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & _
' this.appDir & "\data\keuangan.mdb;Jet OLEDB:Database Password=ppp;")
Dim cmd As New OleDb.OleDbCommand
cmd.Connection = cnn
cmd.CommandType = CommandType.Text
cmd.CommandText = "delete * from trx_spp where `nospp` = '" & e.Link.Split("|")(1) & "' and " & this.sFilter
Using cnn
cnn.open()
cmd.ExecuteNonQuery()
cnn.Close()
End Using
=======================
'Friend koneksi As New _
' Odbc.OdbcConnection("Driver={Microsoft Access Driver (*.mdb)};dbq=" & _
' this.appDir & "\data\keuangan.mdb;defaultdir=D:\;Uid=Admin;Pwd=-+--+;")
'Friend koneksi As New _
' OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & _
' this.appDir & "\data\keuangan.mdb;Jet OLEDB:Database Password=-+--;")
Friend koneksi As New _
OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
this.appDir & "\data\keuangan.mdb;Persist Security Info=False;Jet OLEDB:Database Password=-+;")
OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
this.appDir & "\data\keuangan.mdb;Jet OLEDB:Database Password=ppp;")
' OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & _
' this.appDir & "\data\keuangan.mdb;Jet OLEDB:Database Password=ppp;")
Dim cmd As New OleDb.OleDbCommand
cmd.Connection = cnn
cmd.CommandType = CommandType.Text
cmd.CommandText = "delete * from trx_spp where `nospp` = '" & e.Link.Split("|")(1) & "' and " & this.sFilter
Using cnn
cnn.open()
cmd.ExecuteNonQuery()
cnn.Close()
End Using
=======================
'Friend koneksi As New _
' Odbc.OdbcConnection("Driver={Microsoft Access Driver (*.mdb)};dbq=" & _
' this.appDir & "\data\keuangan.mdb;defaultdir=D:\;Uid=Admin;Pwd=-+--+;")
'Friend koneksi As New _
' OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & _
' this.appDir & "\data\keuangan.mdb;Jet OLEDB:Database Password=-+--;")
Friend koneksi As New _
OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
this.appDir & "\data\keuangan.mdb;Persist Security Info=False;Jet OLEDB:Database Password=-+;")
Jumat, 03 April 2015
Sub Total in Each Row
SELECT [e]+[f] AS masuk, [h]+[i] AS keluar, * FROM kegiatan_2kas WHERE a Like '2.2.1.*.*' And key=2012 ORDER BY b;
Order By Split Column
I have a column call it id:
4.1.2.10.0
4.1.2.3.0
4.1.2.4.0
6.1.20.0.0
6.1.3.0.0
...
etc...
What I'd like to do is include an ORDER BY statement that splits the string, to become like this:
4.1.2.3.0
4.1.2.4.0
4.1.2.10.0
6.1.3.0.0
6.1.20.0.0
...
etc....
you should do
select *
from tbl
order by CInt(mid(field1,1,instr(1,field1,'.')-1)),
CInt(mid(field1,instr(1,field1,'.')+1,instr(2,field1,'.')-1)),
CInt(mid(field1,instr(3,field1,'.')+1,instr(4,field1,'.')-1)),
CInt(mid(field1,instr(5,field1,'.')+1,instr(6,field1,'.')-1))
src https://stackoverflow.com/questions/28934055/order-by-split-column
Rabu, 22 Oktober 2014
SQL Debet, Kredit, Saldo
MYSQL
mysql> select @s:=0;
+-------+
| @s:=0 |
+-------+
| 0 |
+-------+
1 row in set (0.00 sec)
mysql> select @k:=if(kode="k",nominal,0) as Kredit,@d:=if(kode="d",nominal,0) as
debet, @s:=@s+@k-@d as saldo from trx;
+--------+-------+-------+
| Kredit | debet | saldo |
+--------+-------+-------+
| 3434 | 0 | 3434 |
| 3434 | 0 | 6868 |
| 4434 | 0 | 11302 |
| 0 | 544 | 10758 |
| 0 | 453 | 10305 |
+--------+-------+-------+
5 rows in set (0.00 sec)
MSSQL..?
belong to: http://mozzamediart.wordpress.com/2012/08/04/query-mysql-menghitung-saldo-per-transaksi/
Langganan:
Postingan (Atom)