Android Question [solved] Date problem when remote query SQL Server

makis_best

Well-Known Member
Licensed User
Longtime User
Hi

I use this tutorial trying to retrieve data remote from my database.
https://www.b4x.com/android/forum/threads/connect-android-to-ms-sql-server-tutorial.13166/
Everything is working fine and I can retrieve easy everything I want, but there is a problem when I use dates.....

I am using a simple query with a date field.
The query is SELECT RegistrationDate AS Date1 FROM Note1
So I test it in my browser like that
http://192.168.1.1/CONN.ASPX?QUERY=SELECT RegistrationDate AS Date1 FROM Note1
I save the result in a sqllite database

But I get a result like that....

[{"Date1":"\/Date(1498856400000)\/"},{"Date1":"\/Date(1498856400000)\/"},{"Date1":"\/Date(1498856400000)\/"},{"Date1":"\/Date(1498856400000)\/"},{"Date1":"\/Date(1498856400000)\/"},{"Date1":"\/Date(1498856400000)\/"},{"Date1":"\/Date(1498856400000)\/"},{"Date1":"\/Date(1498856400000)\/"},{"Date1":"\/Date(1498856400000)\/"},{"Date1":"\/Date(1498856400000)\/"},{"Date1":"\/Date(1498856400000)\/"},{"Date1":"\/Date(1498856400000)\/"},{"Date1":"\/Date(1498856400000)\/"},{"Date1":"\/Date(1498856400000)\/"},{"Date1":"\/Date(1498856400000)\/"},{"Date1":"\/Date(1498856400000)\/"},{"Date1":"\/Date(1498856400000)\/"},{"Date1":"\/Date(1498856400000)\/"},{"Date1":"\/Date(1498856400000)\/"},{"Date1":"\/Date(1498856400000)\/"},{"Date1":"\/Date(1498856400000)\/"},{"Date1":"\/Date(1498856400000)\/"},{"Date1":"\/Date(1498856400000)\/"},{"Date1":"\/Date(1498856400000)\/"}

Why? what I do wrong?
Is there any way I can solve that problem or the date is correct and I don't know what to do with the result?
 
Last edited:

Mahares

Expert
Licensed User
Longtime User
I don't have any problem doing it in SQL Server.
I need to do it at SQLite
I still do not know what you trying to do. Please show show one example of what the table record column is and how you want it to show in SQLite.
for example 1498856400000 needs to show say 7/2/2018. Give a concrete example. Maybe someone in the forum will understand what you are looking for. You have not explained it so far for someone to give you the answer you are looking for.
 
Upvote 0
Top