realbasic-nug
[Top] [All Lists]

Re: REALSQL Date fields

To: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Subject: Re: REALSQL Date fields
From: Dirk Cleenwerck <fa288588@skynet.be>
Date: Wed, 29 Apr 2009 18:47:19 +0200
Authentication-results: mx.google.com; spf=neutral (google.com: 74.124.194.228 is neither permitted nor denied by best guess record for domain of realbasic-nug-bounces@lists.realsoftware.com) smtp.mail=realbasic-nug-bounces@lists.realsoftware.com
Delivered-to: listarchive@realsoftware.com
In-reply-to: <495C317C-4698-4C5F-A9BE-2C5EBA3A04E2@gsco.de>
References: <C06B41C7-9E84-4E0D-B845-3BC78DC525A6@gsco.de> <49F32F04.6000809@skynet.be> <495C317C-4698-4C5F-A9BE-2C5EBA3A04E2@gsco.de>
Reply-to: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Sender: realbasic-nug-bounces@lists.realsoftware.com
User-agent: Thunderbird 2.0.0.21 (Macintosh/20090302)
Hi again,

For sorting and group queries the easiest seems to be to use an alias, like this

SELECT somefield, Date(MYDATEFIELD) AS MyDate ORDER BY Mydate

Dirk Cleenwerck

Frank Bitterlich wrote:
Hey, that appears to work. It might solve the sorting/GROUP BY problem as well...

Thanks a lot!

Cheers,
   Frank+++

Am 25.04.2009 um 17:40 schrieb Dirk Cleenwerck:

Hi Frank,

Sorry for the late reply, but I've been running all nighters for a while due to a deadline, and therefore hadn't had time to look into it. I seemed to remember that I had solved this problem in the past, and I just look at the code I had. The trick is to use the SQLite functions to help you along. SQLite does have some Date and Time functions as part of it's SQL syntax.
Read this as a reference http://www.sqlite.org/lang_datefunc.html

Anyways, the short answer to you question is to write your query like this:

WHERE Date(MYDATEFIELD)='2009-01-01'...

I thought I'd post it, because I don't think anyone gave you that answer yet.
It worked for me, so I hope it'll work for you too.

Dirk Cleenwerck


--

Günter Schmidt GmbH
Frank Bitterlich             eMail: bitterlich@gsco.de
Ben-Gurion-Ring 21           WWW:   http://www.gsco.de/
D-60437 Frankfurt            Tel.:  069 / 156809-29
GERMANY                      Fax:   069 / 156809-28
Geschäftsführer: Jürgen Hartwich
AG Frankfurt am Main, HRB 76504 - USt.-ID: DE235219624






_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>



_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>


<Prev in Thread] Current Thread [Next in Thread>