I have a custom Type, like this:
	
	
	
	
	
	
	
		
			
			
			
			
			
		
	
	
	
		
	
	
		
	
I read from a database (msaccess) and load the retrieved values into the custom Type, like this:
	
	
	
	
	
	
	
		
			
			
			
			
			
		
	
	
	
		
	
	
		
	
My goal is simply to load the ticks into pr.Effdt. I can see from the Log that it has retrieved ticks, which is perfect, but marked the value as a /Date/ - see image. This is okay with me, but it causes an error on the line pr.Effdt=m.Get("EffDt"). Strangely, the error says "Invalid double" even though the datatype of the target field is Long.
		
		
	
	
		 
	
This should work, no? Is there another (better) way to load a date?
P.S., my temporary workaround is:
	
	
	
	
	
	
	
		
			
			
			
			
			
		
	
	
	
		
	
	
		
	
			
			
			
				B4X:
			
		
		
		Type MyCustomType (UserID As Int, Active As Boolean, EffDt As Long)I read from a database (msaccess) and load the retrieved values into the custom Type, like this:
			
				B4X:
			
		
		
		Dim m As Map
m = rows.Get(i)
Log(m)
Select Job.JobName
  Case "MyJobName"
    Dim pr As MyCustomType
    pr.UserID = m.Get("UserID")
    pr.Active = m.Get("Active")
    pr.EffDt = m.Get("EffDt")
    ListOfMyCustomType.Add(pr)
End SelectMy goal is simply to load the ticks into pr.Effdt. I can see from the Log that it has retrieved ticks, which is perfect, but marked the value as a /Date/ - see image. This is okay with me, but it causes an error on the line pr.Effdt=m.Get("EffDt"). Strangely, the error says "Invalid double" even though the datatype of the target field is Long.
This should work, no? Is there another (better) way to load a date?
P.S., my temporary workaround is:
			
				B4X:
			
		
		
		Dim s As String = m.Get("EffDt")
s = s.SubString2(6, s.Length-2)
pr.EffDt = s
			
				Last edited: 
			
		
	
								
								
									
	
								
							
							 
				 
 
		 
 
		 
 
		 
 
		