Skip to main content

Posts

Showing posts from July, 2013

PARM M.O.V.E. RUN MANILA 2013

The Philippine Academy of Rehabilitation Medicine launch the PARM M.O.V.E (Making Ourselves Vigilant to Exercise) Pilipinas Run 2013 at QC Memorial Circle last July 20, 2013

Iya Villania

Iya Villania at Robinsons  Galleria, July 13, 2013

Combo box with value and text in VB 6

VB 6 Combo box with value and text 1. Add component Microsoft Forms 2.0 2. EngMatchFrm.CmbEngComponent.Clear     EngMatchFrm.CmbEngComponent.ColumnCount = 2     EngMatchFrm.CmbEngComponent.ColumnWidths = "0 in; 2 in"     Dim i As Integer     i = 0     While Not rstComp.EOF             EngMatchFrm.CmbEngComponent.AddItem rstComp!BusinessUnitID         EngMatchFrm.CmbEngComponent.List(i, 1) = rstComp!BUName                 i = i + 1         rstComp.MoveNext             Wend

Calculate Total Hour and Minute in SQL

SELECT ((DATEDIFF(minute, '2013-06-30 08:30:00.0000000', '2013-06-30 10:45:00.0000000'))/60) AS TotalHour,        ((DATEDIFF(minute, '2013-06-30 08:30:00.0000000', '2013-07-30 10:45:00.0000000'))%60) AS TotalMinute The result of the above query is: TotalHour    TotalMinute       2                   15

Sunday Mass at EDSA Shrine

Sunday Mass Celebration at the EDSA Shrine. This Sunday Eucharistic Celebration online at EDSA Shrine is aimed at helping Filipinos living and working abroad be closer to Jesus. However, it shall not take the place of the actual participation in the Sacrament especially for those who can come to church on Sunday. https://www.edsashrine.org

Get Windows User Full Name in VB 6

Code in getting the windows user's fullname. Dim strComputer As String Dim strUserName As String Dim objUser As Object strComputer = "ComputerName" strUserName = "UserName Set objUser = GetObject("WinNT://" & strComputer & "/" & strUserName) msgbox objUser.FullName This is also applicable to vb.net.

Multiple JOIN in MS Access

When you query a multiple join in MSSQL you use this following query: SELECT a.columna, b.columnb, c.columnc FROM tablea AS a LEFT JOIN tableb AS b ON a.id = b.id LEFT JOIN tablec AS c ON a.id = c.id If you use the above query in  MS Access you will encounter an error message "Missing Operator". To resolve that error you should use the following query: SELECT a.columna, b.columnb, c.columnc FROM ((tablea AS a) LEFT JOIN tableb AS b ON a.id = b.id) LEFT JOIN tablec AS c ON a.id = c.id

SQL Time Difference

 Subtracting Date Time in MSSQL --YEAR SELECT DATEDIFF(year, '2012-12-31', '2013-01-01') --Quarter SELECT DATEDIFF(quarter, '2012-01-01 23:59:59', '2013-01-01 00:00:00') --Month SELECT DATEDIFF(month, '2012-12-31 23:59:59.9999999', '2013-02-01 00:00:00.0000000') --Day SELECT DATEDIFF(day, '2012-12-01 23:59:59.9999999', '2012-12-31 00:00:00.0000000') --Week SELECT DATEDIFF(week, '2013-06-01 23:59:59.9999999', '2013-06-30 00:00:00.0000000') --Hour SELECT DATEDIFF(hour, '2013-06-30 08:30:00.0000000', '2013-06-30 17:30:00.0000000') --Minute SELECT DATEDIFF(minute, '2013-06-30 08:30:00.0000000', '2013-06-30 17:30:00.0000000') --Second SELECT DATEDIFF(second, '2013-06-30 08:30:00.0000000', '2013-06-30 08:30:25.0000000') --Millisecond SELECT DATEDIFF(millisecond, '2005-12-31 23:59:59.9999999', '2006-01-01 00:00:00.0000000')...

VB 6 Send Email

VB Send Email with a HTML Format body Private Sub Command1_Click() Dim EmailList, Mailbod As String, Myfile Dim objOutlook As Outlook.Application Dim newapp As Outlook.MailItem, objRecip As Outlook.Recipient Dim objRWhtm As Outlook.Attachment Dim StrBody As String Dim Myfile As String StrBody="<font color='red'>Hello World</font>" Myfile="C:\Temp\attached.doc   Set newapp = Outlook.Application.CreateItem(olMailItem) Set objOutlook = CreateObject("Outlook.Application") Set objRecip = newapp.Recipients.Add("user@email.com") 'list of recipients for the message 'Set objRWhtm = newapp.Attachments.Add(Myfile) 'optional command if you want to attach a file 'specify MyFile as file path for desired file to be sent       newapp.Subject = Mailbod 'Sets the subject of the e-mail newapp.HTMLBody = StrBody 'send html format email 'newapp.Body = "Hello World" 'Plain Text Body newapp....

Copy file and rename copied file using MS DOS command

Copy File then rename the copied file with date and time using dos command C:\FileName.bak Z:\ /C /Y ren Z:\FileName.bak FileName.bak%date:~4,2%-%date:~7,2%-%date:~10,4%-%time:~1,1%%time:~3,2%%time:~6,2% I discovered that when the folder name is with spaces. just put a double qoute. XCOPY C:\FileName.bak Y:\"Folder Name"\"Sub Folder"\ /C /Y ren Y:\"Folder Name"\"Sub Folder"\ Filename.bak FileName.bak%date:~4,2%%date:~7,2%%date:~10,4%-%time:~1,1%%time:~3,2%%time:~6,2%