Hey there,
from my experiance with Jabaco the Format and Date -related functions don't allways work as expected!
So you might be better off doing some dirty stringmanipulations.
Just do get this working look at this
|
Jabaco Source
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
Option Explicit
Public Sub Form_Load()
Dim Dob As String = InputBox("Please enter the Date Of Birth:", "DOB")
'2012/10/01
'expected inputformat for DateDiff -> dd.MM.yyyy
MsgBox DateDiff("d", MyDate(Dob), MyDate(Now))
End Sub
Public Function MyDate(d As String) As Date
'Input -> yyyy/mm/dd
'Output -> dd.mm.yyyy
Dim sdt() As String
Dim sd() As String
sdt = Split(d," ")
sd = Split(sdt(0),"/")
MyDate = CDate(sd(2) & "." & sd(1) & "." & sd(0))
' If UBound(sdt)> 0 Then MyDate = MyDate & " " & sdt(1)
End Function
'https://code.google.com/searchframe#pOD0Tthq4jU/trunk/Framework/src/VBA/DateTime.java&q=DateDiff%20package:jabacoframework%5C.googlecode%5C.com
'
|
Dani