so you are saying that SELECT * FROM some_table WHERE some_date LIKE
"2010%"
is not possible?
On Dec 3, 9:30 am, bruno desthuilliers
wrote:
> On 3 déc, 17:37, owidjaya wrote:
>
> > in php I can run the following query for mysql
>
> > SELECT * FROM some_table WHERE some_date LIKE "2010%"
>
> > H
On 3 déc, 17:37, owidjaya wrote:
> in php I can run the following query for mysql
>
> SELECT * FROM some_table WHERE some_date LIKE "2010%"
>
> How do i do this in django using cursor.execute()?
sql = "SELECT * FROM some_table WHERE YEAR(some_date)=%s"
cursor.execute(sql, (2010,))
--
You receiv
On Dec 3, 11:13 am, oscar widjaya wrote:
> It's for mysql
> it still does not work. I tried it with the following sql statement
> "SELECT * FROM project_project WHERE start_date LIKE '%s'" % '2010%%'
Well, I assume that the double % at the end of your query is
unintentional, as I don't think it
It's for mysql
it still does not work. I tried it with the following sql statement
"SELECT * FROM project_project WHERE start_date LIKE '%s'" % '2010%%'
On Dec 3, 9:04 am, wayne wrote:
> On Dec 3, 10:47 am, owidjaya wrote:
>
> > It says incorrect date value.
>
> What database are you using? I'm
It's for mysql
it still does not work. I tried it with the following sql statement
"SELECT * FROM project_project WHERE start_date LIKE '%s'" % '2010%%'
On Fri, Dec 3, 2010 at 9:04 AM, wayne wrote:
>
>
> On Dec 3, 10:47 am, owidjaya wrote:
> > It says incorrect date value.
> >
>
> What databas
On Dec 3, 10:47 am, owidjaya wrote:
> It says incorrect date value.
>
What database are you using? I'm wondering if this is an issue of
formatting the sql correctly. Did you read the snippet near the
bottom of the page I linked to? Try:
SELECT * FROM some_table WHERE some_date LIKE "%s" % '
It says incorrect date value.
On Dec 3, 8:44 am, wayne wrote:
> You should be able to do it just as you mention, passing the query
> string to cursor.execute().
>
> Seehttp://docs.djangoproject.com/en/dev/topics/db/sql/#executing-custom-...
>
> Have you tried this? Are you getting an error? If
You should be able to do it just as you mention, passing the query
string to cursor.execute().
See
http://docs.djangoproject.com/en/dev/topics/db/sql/#executing-custom-sql-directly
Have you tried this? Are you getting an error? If so, what is it?
--
You received this message because you are
in php I can run the following query for mysql
SELECT * FROM some_table WHERE some_date LIKE "2010%"
How do i do this in django using cursor.execute()?
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django
9 matches
Mail list logo