You Are Here:

Community: Developer Discussion Boards

#1 Old Unhappy e32db query date comparison - 2008-12-12, 00:33

Join Date: Nov 2008
Posts: 4
fhaeser1
Offline
Registered User
Hi,

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

Thanks in advance for any help
Reply With Quote

#2 Old Re: e32db query date comparison - 2008-12-12, 05:36

Join Date: Oct 2007
Posts: 2,841
Location: Deva, Romania
bogdan.galiceanu's Avatar
bogdan.galiceanu
Online
Forum Nokia Champion
Hi,

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:
Quote:
format_time(timevalue)
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.
Reply With Quote

#3 Old Smile [SOLVED] e32db query date comparison - 2008-12-12, 09:01

Join Date: Nov 2008
Posts: 4
fhaeser1
Offline
Registered User
Thank you for providing me the solution. Simply formatting each timestamp with e32db.format_time(timestamp) worked.
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
Thread Thread Starter Forum Replies Last Post
How to compare date Sql Query in Symbian kamaljaiswal General Symbian C++ 2 2009-08-31 01:57
e32db date field Cyxapeff2 Python 1 2007-07-29 11:22
Date Query Dialog vasant21 Symbian User Interface 2 2006-11-01 12:50
Date Query djgtram Symbian User Interface 3 2004-03-17 23:33
Date Query Editor Dialog Blkangel General Symbian C++ 0 2004-02-11 11:48

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia