On 2/19/2010 5:25 PM, Keith Clark wrote:
On Fri, 2010-02-19 at 17:12 -0500, Keith Clark wrote:
On Fri, 2010-02-19 at 17:05 -0500, Drew Jensen wrote:
On 2/19/2010 4:51 PM, Keith Clark wrote:
How would I select my data, in design view, using a criterion like:
now()-30 days
That does not seem to work btw.
Hell Keith
Right now, using the embedded database engine, you can't do that - well,
you already know don't you.
In the next major release 3.3 this will be available by the way.
In the meantime you can do this:
DATEDIFF('dd', "date_col", CURDATE() ) = 30
Drew,
Sorry about some confusion here. I'm connected to a MySQL database.
Keith
This actually seems to work in the design view Criterion box:
< NOW( ) - 00000100000000
Returns all dates older than 30 days from now.
Ok, then in MySQL you can use the DATE_SUB function for this.
Using Base you will need to do this in SQL direct mode (escape
processing turned off)
and your original question is 'in design view'...ah yes a little reading
would save us both time.
bugger...
well it would be something like
COl (in the field row )
CURRENT_DATE - 30 (in the criteria row for exactly 30 days ago)
That works if you do not move off the criteria row in the query
designer, but as soon as you do it quotes all of it...
If you try it as a calculated column with an alias, so you can use the
alias in a where clause...it takes CURRENT_DATE
It quotes again CURRENT_DATE - 30
I'm using XP, a DEV build of OO.o 3.3 and the MySQL native connector
1.0.1_alpha and your criteria expression doesn't work..same behavior as
the current_date
< NOW( ) - 00000100000000
Again this all in the designer if I turn designer off, and still leave
escape processing on (so parameters work) I can then get the SQL to work
as expected.
I'll fiddle with OO.o 3.2 and the 1.0 stable connector a bit later.
Still, Looks like you might want to open an issue on this or I will if
you like.
Drew
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]