Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Nov 2008

    Unhappy e32db query date comparison


    i want to reduce the resulting resultset with a date comparsison i.e. date between lastcall and now. my query looks like this
    query = u"SELECT * from table WHERE 
          date > #%s# AND date < #%s#"%(time.time()-1000000,time.time())
    The error on the phone tells me:
    SymbianError:[Errno -2] KErrGeneral
    What I am making wrong?

    Thanks in advance for any help

  2. #2
    Super Contributor
    Join Date
    Oct 2007
    Deva, Romania

    Re: e32db query date comparison


    I think the problem is with the way you are trying to use time. According to this article it has to be formatted using e32db.format_time function.
    From the PyS60 Library Reference:
    Returns timevalue as a Unicode string formatted so that it is acceptable as a SQL time. To make a time literal, surround the return value with hash (#) characters.

  3. #3
    Registered User
    Join Date
    Nov 2008

    Smile [SOLVED] e32db query date comparison

    Thank you for providing me the solution. Simply formatting each timestamp with e32db.format_time(timestamp) worked.

Similar Threads

  1. How to compare date Sql Query in Symbian
    By kamaljaiswal in forum Symbian
    Replies: 2
    Last Post: 2009-08-31, 00:57
  2. e32db date field
    By Cyxapeff2 in forum Symbian
    Replies: 1
    Last Post: 2007-07-29, 10:22
  3. Date Query Dialog
    By vasant21 in forum Symbian User Interface
    Replies: 2
    Last Post: 2006-11-01, 11:50
  4. Date Query
    By djgtram in forum Symbian User Interface
    Replies: 3
    Last Post: 2004-03-17, 22:33
  5. Date Query Editor Dialog
    By Blkangel in forum Symbian
    Replies: 0
    Last Post: 2004-02-11, 10:48

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts