Spent quite a lot of time spotting the problem in the following code fragment:
Problem was that iNewDBDay and iNewDBMonth got the wrong value, think it was 2 and 1.
There is no crash or error at all.
Dates (iNewDBDate) are Excel dates so values like 43817 (today's date).
I take it this will be easy to spot for more experienced B4A users.
It took me a long time as all works fine if you step through the code in debug mode.
RBS
B4X:
Sub UpdatePatientsAge
Dim i As Int
Dim iNewDBDate As Int
Dim iDOB As Int
Dim strSQL As String
Dim RS1 As ResultSet
Dim lstIDAge As List
Dim lTicks As Long
Dim iNewDBDay As Int
Dim iNewDBMonth As Int
Dim iDOBDay As Int
Dim iDOBMonth As Int
strSQL = "select int_val from settings where name = 'NEW_DB_DATE'"
iNewDBDate = SQL1.ExecQuerySingleResult(strSQL)
lTicks = (iNewDBDate - 25569) * 86400000 - 3600000
iNewDBDay = DateTime.GetDayOfMonth(lTicks)
iNewDBMonth = DateTime.GetMonth(lTicks)
Problem was that iNewDBDay and iNewDBMonth got the wrong value, think it was 2 and 1.
There is no crash or error at all.
Dates (iNewDBDate) are Excel dates so values like 43817 (today's date).
I take it this will be easy to spot for more experienced B4A users.
It took me a long time as all works fine if you step through the code in debug mode.
RBS