28 April 2007

Age calculate by Birthday


if(crmForm.all.birthdate.DataValue != null)
{
var now = new Date();
var birthday = crmForm.all.birthdate.DataValue;
var monthdif = now.getMonth() - birthday.getMonth();
if(monthdif > -1)
crmForm.all.new_age.DataValue = now.getYear() - birthday.getYear();
else
crmForm.all.new_age.DataValue = now.getYear() - birthday.getYear() - 1;
}

21 April 2007

Uninstall WSS 3.0 MICROSOFT##SSEE Database

Sometimes we need to uninstall WSS 3.0 database manually, here is the way:
1. HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
2. Look for each {GUID} which Display Name = "Microsoft SQL 2005 Embedded Edition"
3. Run: MsiExec.exe /X {GUID} CALLERID=OCSETUP.EXE

09 April 2007

WORD TIPS 1 – Find and Replace

History: XXXX

History 02): XXXX

History 03): XXXX


Use Find and Replace (Use wildcards):

Find what: ^13History ([0-9][0-9])

Replace with: , \1

History: XXXX , 02): XXXX , 03): XXXX

05 April 2007

EXCEL Tips 2

'Macro to split cells at the comma

Sub SplitName()
Dim cell As Range
Dim separator As Integer
'loop through each cell in the selection
For Each cell In Selection
'search for a comma
separator = InStr(cell.Value, ",")
If separator > 0 Then
'put the lastname in the first column to the right
cell.Offset(0, 1).Value = Left(cell.Value, separator - 1)
'put the firstnames in the second column to the right
cell.Offset(0, 2).Value = Mid(cell.Value, separator + 1)
End If
Next cell
End Sub


'Macro to join 2 cells

Sub Join()
Application.ScreenUpdating = False
Application.Calculation = xlCalculationAutomatic
On Error Resume Next
Dim irows As Long, mrows As Long, ir As Long, ic As Long
irows = Selection.Rows.Count
Set lastcell = Cells.SpecialCells(xlLastCell)
mrow = lastcell.Row
If mrow < irows =" mrow" icols =" Selection.Columns.Count" ir =" 1" newcell =" Trim(Selection.Item(ir," ic =" 2" trimmed =" Trim(Selection.Item(ir,"> 0 Then newcell = newcell & " " & trimmed
Selection.Item(ir, ic) = ""
Next ic
Selection.Item(ir, 1).Value = newcell
Next ir
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
End Sub

EXCEL Tips 1


User

Hobby

Read

Internet

Music

Computer

User1

Reading,Internet,Music

Yes

Yes

Yes

No

User2

Internet,Computer,Reading

Yes

Yes

No

Yes

User3


No

No

No

No

User4

Music

No

No

Yes

No


=IF(ISERR(FIND(C$1,$B2)),"No","Yes")