|
Posted by meltedown on 11/09/23 11:28
Steve wrote:
>>Why doesn't this return anything ?
>>
>>SELECT DATE_SUB('FROM_DAYS(TO_DAYS(2005-09-28 18:04:19))', INTERVAL 6 DAY)
>
>
> Uh. Dunno. What are you typing it into? What language do you think it
> is? It looks a bit like a MySQL query, but mangled; is that what you
> intended? If it is, why are there single quotes around the first
> argument to DATE_SUB()? Is there another DATE_SUB() that expects a
> string rather than a date? Yes, it's definitely a mystery...
>
> ---
> Steve
>
Its mysql.
If I take the quotes out, I get an error
query failed:1064: You have an error in your SQL syntax; check the
manual that corresponds to your MySQL server version for the right
syntax to use near '18:04:19)), INTERVAL 6 DAY)' at line 1
query was:
SELECT DATE_SUB(FROM_DAYS(TO_DAYS(2005-09-28 18:04:19)), INTERVAL 6 DAY)
I'm trying to get the date that's a week before the date in the query.
Navigation:
[Reply to this message]
|