Android Question Sqlite null date returns 01/01/1970

Makumbi

Well-Known Member
Licensed User
Please help my
B4X:
SELECT DISTINCT Names,DESCRIPT,DEBITAMNT,CREDITAMNT,TREF, TRDATE,BAL As Balance FROM Statement

my TRDATE returns 01/01/1970 when is null

Please help me out
 

Attachments

  • Screenshot_1545578452.png
    Screenshot_1545578452.png
    77.6 KB · Views: 219

Computersmith64

Well-Known Member
Licensed User
Longtime User
What SQLite type are you using for TRDATE? Can you post the code that processes the result of the query?

- Colin.
 
Upvote 0

RB Smissaert

Well-Known Member
Licensed User
Longtime User
How about doing:

SELECT DISTINCT Names,DESCRIPT,DEBITAMNT,CREDITAMNT,TREF, coalesce(TRDATE, ''), BAL As Balance FROM Statement

RBS
 
Upvote 0

OliverA

Expert
Licensed User
Longtime User
my TRDATE returns 01/01/1970 when is null
Are you sure? How are you retrieving TRDATE from the resultset? Via GetString/GetString2? Another method? If via another method, how are you converting the retrieved value to a date? Also, are you sure you are storing NULLs? Could it be that when storing the date it is stored as '01/01/1970'? You have no code posted (retrieval and display), nor any screenshots of a data dump that we can go by, therefore my various questions.
 
Upvote 0
Top