Converting date to ticks value

mozaharul

Active Member
Licensed User
Hi,

I convert a date value (from database) to ticks value and assign to a variable.
I can see the date in the table use in the "cmd.ExecuteTable" statement, but the variable shows zero (0) value after conversion. the code is like :

cmd.CommandText="select dob from member where perm_pid= "&tt&""
cmd.ExecuteTable("table12",0)
mm=DateParse(table12.Cell("dob",0))
Msgbox("dob :"&mm) ; shows dob : 0

Please correct me.


regards,
 

Byak@

Active Member
Licensed User
i'm think in your table you use another dateformat.
what is table12.Cell("dob",0) it?
 

Ricky D

Well-Known Member
Licensed User
Longtime User
try looking at the format

what DateFormat are you using?

I store my dates in SQLite as yyyy-mm-dd

so in my program I use DateFormat("yyyy-mm-dd")

what formats are your dates showing in the table?

eg mine are 2008-10-21 which is 21 October 2008

match the DateFormat with what your table shows

hope this makes sense.

regards, Ricky
 

mozaharul

Active Member
Licensed User
Hi Byak@ and Ricky D,

Thanks for your time. It work now like:

dateformat("dd/mm/yyyy")
cmd.CommandText="select dob from member where perm_pid= "&tt&""
cmd.ExecuteTable("table12",0)
mm=DateParse(table12.Cell("dob",0))
Msgbox("dob :"&mm) ; shows dob : 0


Best regards,
 
Top