hello
i got a small problem to save a Date and Time in the MSSQL DB, exactly when a button is pressed should Save "Now"
If i try to save the App crash with the Error
i got a small problem to save a Date and Time in the MSSQL DB, exactly when a button is pressed should Save "Now"
If i try to save the App crash with the Error
B4X:
In VB NET i do and Works perfect
"aCmd.Parameters.AddWithValue("@CheckIn", Now) "
'***In V4A i tried many option but don't get the proper result
'***My Code
Dim CheckIn As String
Dim dateNow As Long = DateTime.Now
DateTime.DateFormat = "dd/MM/yyyy"
DateTime.timeFormat = "hh:mm:ss"
Dim sCheckIn_Day As String = DateTime.Date(dateNow)
Dim sCheckIn_Time As String = DateTime.Time(dateNow)
Log("CheckIn " & sCheckIn_Day & " " & sCheckIn_Time) '*** gives the correct data 27/09/2019 02:52:16 as it is in the DB
CheckIn = sCheckIn_Day '& " " & sCheckIn_Time '** only save sCheckIn_Day gives 1900-01-01 00:00:00.000, both together chrash the APP
msSQL.ExecNonQuery("insert into CheckInOut_Table (UserID, CheckIn) Values(51, " & CheckIn & ")")