Converting date to ticks value

Discussion in 'Questions (Windows Mobile)' started by mozaharul, Oct 22, 2008.

  1. mozaharul

    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,
     
  2. Byak@

    Byak@ Active Member Licensed User

    i'm think in your table you use another dateformat.
    what is table12.Cell("dob",0) it?
     
  3. Ricky D

    Ricky D Well-Known Member Licensed 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
     
  4. mozaharul

    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,
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice