Monday, February 17, 2014

SQL Crosstab Query by Month

SELECT KodeRek, " & _
                      "SUM(CASE WHEN MONTH(TGL) = 1 THEN TRANSAKSI ELSE 0 END) AS JAN, SUM(CASE WHEN MONTH(TGL) = 2 THEN TRANSAKSI ELSE 0 END) AS FEB, " & _
                      "SUM(CASE WHEN MONTH(TGL) = 3 THEN TRANSAKSI ELSE 0 END) AS MAR, SUM(CASE WHEN MONTH(TGL) = 4 THEN TRANSAKSI ELSE 0 END) AS APR, " & _
                      "SUM(CASE WHEN MONTH(TGL) = 5 THEN TRANSAKSI ELSE 0 END) AS MAY, SUM(CASE WHEN MONTH(TGL) = 6 THEN TRANSAKSI ELSE 0 END) AS JUN, " & _
                      "SUM(CASE WHEN MONTH(TGL) = 7 THEN TRANSAKSI ELSE 0 END) AS JUL, SUM(CASE WHEN MONTH(TGL) = 8 THEN TRANSAKSI ELSE 0 END) AS AUG, " & _
                      "SUM(CASE WHEN MONTH(TGL) = 9 THEN TRANSAKSI ELSE 0 END) AS SEP, SUM(CASE WHEN MONTH(TGL) = 10 THEN TRANSAKSI ELSE 0 END) AS OCT, " & _
                      "SUM(CASE WHEN MONTH(TGL) = 11 THEN TRANSAKSI ELSE 0 END) AS NOV, SUM(CASE WHEN MONTH(TGL) = 12 THEN TRANSAKSI ELSE 0 END) AS DEC " & _
"FROM V_JURNAL WHERE YEAR(TGL)=" & cmbTahun.Text & "" & _
"GROUP BY KodeRek"

Sunday, February 09, 2014

Calculating age from a birth date in Access

=DateDiff("yyyy", [Birthdate], Now())+ Int( Format(now(), "mmdd") < Format( [Birthdate], "mmdd") )

Sunday, January 26, 2014

Format Date Time SQL

SELECT convert(varchar, getdate(), 100) - mon dd yyyy hh:mmAM (or PM)
                                        - Oct  2 2008 11:01AM          
SELECT convert(varchar, getdate(), 101) - mm/dd/yyyy 10/02/2008                  
SELECT convert(varchar, getdate(), 102) - yyyy.mm.dd - 2008.10.02           
SELECT convert(varchar, getdate(), 103) - dd/mm/yyyy
SELECT convert(varchar, getdate(), 104) - dd.mm.yyyy
SELECT convert(varchar, getdate(), 105) - dd-mm-yyyy
SELECT convert(varchar, getdate(), 106) - dd mon yyyy
SELECT convert(varchar, getdate(), 107) - mon dd, yyyy
SELECT convert(varchar, getdate(), 108) - hh:mm:ss
SELECT convert(varchar, getdate(), 109) - mon dd yyyy hh:mm:ss:mmmAM (or PM)
                                        - Oct  2 2008 11:02:44:013AM   
SELECT convert(varchar, getdate(), 110) - mm-dd-yyyy
SELECT convert(varchar, getdate(), 111) - yyyy/mm/dd
SELECT convert(varchar, getdate(), 112) - yyyymmdd
SELECT convert(varchar, getdate(), 113) - dd mon yyyy hh:mm:ss:mmm
                                        - 02 Oct 2008 11:02:07:577     
SELECT convert(varchar, getdate(), 114) - hh:mm:ss:mmm(24h)
SELECT convert(varchar, getdate(), 120) - yyyy-mm-dd hh:mm:ss(24h)
SELECT convert(varchar, getdate(), 121) - yyyy-mm-dd hh:mm:ss.mmm
SELECT convert(varchar, getdate(), 126) - yyyy-mm-ddThh:mm:ss.mmm
                                        - 2008-10-02T10:52:47.513
- SQL create different date styles with t-sql string functions
SELECT replace(convert(varchar, getdate(), 111), -/-, - -) - yyyy mm dd
SELECT convert(varchar(7), getdate(), 126)                 - yyyy-mm
SELECT right(convert(varchar, getdate(), 106), 8)          - mon yyyy

Thursday, October 31, 2013

VB.Net Get Data From SQL Server & Display in DataGridView (OLEDB)

VB.Net Get Data From SQL Server & Display in DataGridView (OLEDB)

VB.Net, by admin. Code below for retrieve data from SQL Server and display in DataGridView.
Dim da As OleDb.OleDbDataAdapter
Dim SQL As String
Dim dt As New DataTable
SQL = “Select * From TableName”
da = New OleDb.OleDbDataAdapter(SQL, conn)
da.Fill(dt)
DataGridView1.DataSource = dt

Source: http://it-solve.hostoi.com/?p=175

Sunday, October 27, 2013

Saat sujud, tangan dahulu..

Dari Abu Hurairah, dia berkata Rasulullah shallallahu’alaihi wa sallam telah bersabda: ” Apabila salah seorang dari kamu sujud maka janganlah di turun (ke sujud) sebagaimana turunnya onta, dan hendaklah dia meletakkan kedua tangannya (turun dengan kedua tangannya lebih dahulu) sebelum kedua lututnya “.

Thursday, September 19, 2013

Import/Export Data using Management Studio Express?

Need to import/export data from a table in SQL? if you are using Microsoft SQL Management Studio Express, you can't find that tools. So you need to download  from Microsoft SQL Server 2005 Express Edition Toolkit:

http://www.microsoft.com/downloads/details.aspx?FamilyID=3c856b93-369f-4c6f-9357-c35384179543&displaylang=en

After installation done,  you can find it under: C:\Program Files\Microsoft SQL Server\90\DTS\Binn\DTSWizard.exe


Tuesday, September 17, 2013

Iseng..while wait compiling..KLA Project - Kidung Mesra

KLA Project - Kidung Mesra 
Kutulis sebaris kata
walau sederhana
Tertuju bagimu, Nona
yang mengusik jiwa
*Senyummu bunga…musim cerah
Matamu surya…memancar ramah
Ingin selami samudra hatimu
temukan mutiara tiada tara
Lalu terlena rebah didasarnya
Ingin masuki puri di hatimu
hangatkan ruangnya dengan cinta
Dalam irama kita berdansa
dan terbuai
kidung mesra
milik kita
Kususun serangkai nada
walaupun biasa
Terlantun bagimu, Nona
yang menyentuh jiwa

Monday, September 16, 2013

Crystal Report Error "Runtime Error 20532 Cannot Find Database DLL"

When you find this error on Crystal Report when you print, here is the solution:
By registering a DLL named p2sodbc.dll from Start -> Run -> Regsvr32 /s p2sodbc.dll

Sunday, September 15, 2013

You receive the “Interface not registered” error message when you try to send or to save an e-mail message to the Drafts folder in Outlook 2002

You receive the “Interface not registered” error message when you try to send or to save an e-mail message to the Drafts folder in Outlook 2002.

Solution:

To resolve this problem, register the Ole32.dll file. To do this, follow these steps:

  1. Click Start, click Run, type the following command in the Open box, and then click OK:
    Regsvr32.exe %Windir%\System32\Ole32.dll
  2. In the RegSvr32 dialog box, click OK.
Source: http://support.microsoft.com/kb/870707

 

Thursday, August 29, 2013

How to find duplicates in Excel

To find duplicate records:
Put this at formula, and change rows number as needed. =IF(COUNTIF(C$4:C$1000,C129)>1,"Duplicated","")

Full Documentation at: http://www.techrepublic.com/blog/windows-and-office/how-to-find-duplicates-in-excel-245163/

Tuesday, August 20, 2013

VB6 Package and Deployment wizard compile error 80010108

This is a known issue and has been tracked. The Track ID is 53800.

To resolve this error, open Crystl32.dep in Notepad or a similar text 
editor and modify the section: 

[CRPE32.DLL]
Dest=$(WinSysPath)
Uses1=CRPE32.DLL
Uses2

Now just comments above lines as shown below in Crystl32.dep. 

;[CRPE32.DLL]
;Dest=$(WinSysPath)
;Uses1=Crpe32.dll
;Uses2= 

Also ensure that the Crystl32.dep file is in the \WinNT\System32 folder.

Thursday, May 23, 2013

MS. Excel: ISNA function

To handle error #N/A In Microsoft Excel, when use VLOOKUP function searches for value in the left-most column of table_array and returns the value in the same row based on the index_number.
One problem that can occur is when there is not a match so it returns N/A. Here is an example:


Tuesday, February 08, 2011

Baca NTFS dari Red Hat Linux 5 Enterprise

Seperti biasa, tiap kali mencoba install Linux (RHEL 5), partisi NTFS ga langsung bisa dibaca oleh Linux. Agar bisa dibaca dan bisa di modifikasi, ikuti langkah berikut.

1. Dari CD Installer Red Hat Linux 5, cari file:
fuse-2.7.4-8.el5.i386.rpm
fuse-libs-2.7.4-8.el5.i386.rpm
fuse-devel-2.7.4-8.el5.i386.rpm


2. Install file tsbt dg cara:

rpm -ivh nama file tsb diatas.

3. Download file fuse-ntfs-3g-1.417-1.el5.rf.i386.rpm dari http://rpmforge.sw.be/redhat/el5/en/i386/rpmforge/RPMS/fuse-ntfs-3g-1.417-1.el5.rf.i386.rpm

3. Install file use-ntfs-3g-1.417-1.el5.rf.i386.rpm.

rpm -ivh use-ntfs-3g-1.417-1.el5.rf.i386.rpm

4. Setelah sukses terinstall buat folder di /mnt/ntfs, sebagai tempat untuk mounting file NTFS.

5. Edit /etc/fstab, tambahkan baris berikut:
/dev/sdd5 /mnt/ntfs ntfs-3g defaults, force 0 0

dimana /dev/sdd5 adalah partisi yg berisi NTFS.

6. Selamat mencoba.

Monday, February 07, 2011

Install VNC Server on RH5 Enterprise

VNC Server is simple software used to remotely access other computers over a local network or the internet. With the help of Data Encryption and Secure Login your information will be kept confidential.

VNC stands for Virtual Network Computing, and it uses 2 small programs: Server and Viewer. The Server handles the service, and "serves" the access to the host computer. The Viewer is used to access the computer where the server is installed and configured. There are many interesting and time saving uses of the VNC Server, such as in a System Administration or Help Desk Scenario, where the Administrator or technician uses it to access the user's computer and diagnose/fix any problems without the need of phyjavascript:void(0)sically going to his desktop. Another common scenario is in a classroom, where students can access the instructor's computer and from their screen they can see step by step what is being done.

With VNC Server, Free Edition is compatible with almost all versions of Microsoft Windows, from 95 to Vista, and also, depending on the license, with Linux, Solaris, MacOS. Besides the Server Free Edition, Personal and Enterprise Editions are available, depending on the user's needs.

How to install on Redhat Enterprise Linux 5
1. Check if you have vnc-server package already installed
rpm -q vnc server
2. If not, just got your cd installer, and find the file vnc-server. The file that I used on this installation is : vnc-server-4.1.2-14.el5_3.1.i386.rpm then install it.
rpm -ivh vnc-server-4.1.2-14.el5_3.1.i386.rpm

3. VNC Server requires 5000-5999 ports to be opened on firewall.

a. Click on System > Administration > Security Level and Firewall
b. Click other port > Add > enter 5000-5999 to the ports box
c. Click OK.



3. You need to enable Remote Visual Access.

Open the the file /root/.vnc/xstartup with a text editor and uncomment the following lines by remove the # sign from the line:
#unset SESSION_MANAGER
#exec /etc/X11/xinit/xinitrc
4. Running the VNC Server

vncserver :1

This command will ask you to set an access password. You can later change this initial password with vncpasswd command.

4. Restarting the VNC Server

service vncserver restart

5. From Windows you can try to access to Red Hat using VNC Viewer.







More Resources:

http://vnc-server-free-edition.software.informer.com/
http://kbase.redhat.com/faq/FAQ_79_3976.shtm
http://www.tightvnc.com/vncserver.1.html

Thanks a lot to EASEUS Data Recovery


Ga ada angin ga ada ujan..Linux server yang biasanya tangguh, akhirnya collapse juga. Penyebabx listrik yang ujug" mati mendadak. Ketika dinyalakan, terdengar bunyi hardisk yang mengerang, meskipun bisa selesai melakukan booting, tapi untuk membuaka sebuah file terasa berat sekali. Maka segera dilakukan tindakan darurat selagi hardisk masih bisa bernapas, karena ada data yang harus diselamatkan. Baru pertama kali mendapatkan musibah begini, jadi rada grogi juga, software apa yg bisa melakukan recovery partisi linux.

Setelah googling ksana kemari banyak juga software yg bisa melakukan recover partisi linux, rata-2 berbayar. Tapi untunglah ada satu software yang namanya EASEUS Data Recovery, freeware pula. Coba download dan install di Windows XP, serta tidak lupa hardisk linux di pasang.

Setelah program EASEUS Data Recovery diajalankan, dia mulai mengenal hardisk dengan file system ext2 dan ext3. Pilih partisi tersebut dan setelah menunggu hampir 3 jam untuk hardisk kapasitas 250GB..howalaah...hampir 80% data bs di selamatkan..

Thursday, July 15, 2010

Tampilkan File yang disembunyikan oleh Virus

Jangan panik kalo file anda tiba-tiba tidak ada didalam flashdisk yang disebabkan oleh virus. Berikut cara untuk menampilkan kembali:

1. Klik Start -> Run -> Ketikkan CMD
2. Lihat dimana folder Flashdisk anda, misal G.
3. Dari DOS, ketikkan G:\
4. Ketikkan perintah berikut: attrib –s –h *.* /s /d