Skip to main content
deleted 39 characters in body; edited tags; edited title
Source Link
CL.
  • 5.3k
  • 1
  • 22
  • 23

using current day and month in sql query in sqlite3 inserting multiple values into SQL with %

this queryworksThis works:

cursor = conn.execute("""Select FAMILY,F_NAME from birthday where B_MONTH = '%s' """ % (currentMonth))

I cannot seem to expand it to work using an AND clause to also include day as such, I get a syntax error:

cursor = conn.execute("""Select FAMILY,F_NAME from birthday where B_MONTH = '%s' AND B_DAY = '%s' """ % (currentMonth),%(currentDay))

this does not work, where did I go wrong?

using current day and month in sql query in sqlite3

this queryworks

cursor = conn.execute("""Select FAMILY,F_NAME from birthday where B_MONTH = '%s' """ % (currentMonth))

I cannot seem expand it to work using an AND clause to also include day as such:

cursor = conn.execute("""Select FAMILY,F_NAME from birthday where B_MONTH = '%s' AND B_DAY = '%s' """ % (currentMonth),%(currentDay))

this does not work, where did I go wrong?

inserting multiple values into SQL with %

This works:

cursor = conn.execute("""Select FAMILY,F_NAME from birthday where B_MONTH = '%s' """ % (currentMonth))

I cannot seem to expand it to work using an AND clause to also include day, I get a syntax error:

cursor = conn.execute("""Select FAMILY,F_NAME from birthday where B_MONTH = '%s' AND B_DAY = '%s' """ % (currentMonth),%(currentDay))
Code formatting
Source Link
Akina
  • 20.3k
  • 2
  • 19
  • 22

this queryworks; cursor = conn.execute("""Select FAMILY,F_NAME from birthday where B_MONTH = '%s' """ % (currentMonth))queryworks

cursor = conn.execute("""Select FAMILY,F_NAME from birthday where B_MONTH = '%s' """ % (currentMonth))

I cannot seem expand it to work using an AND clause to also include day as such: cursor = conn.execute("""Select FAMILY,F_NAME from birthday where B_MONTH = '%s' AND B_DAY = '%s' """ % (currentMonth),%(currentDay)) this

cursor = conn.execute("""Select FAMILY,F_NAME from birthday where B_MONTH = '%s' AND B_DAY = '%s' """ % (currentMonth),%(currentDay))

this does not work, where did I go wrong?

this queryworks; cursor = conn.execute("""Select FAMILY,F_NAME from birthday where B_MONTH = '%s' """ % (currentMonth))

I cannot seem expand it to work using an AND clause to also include day as such: cursor = conn.execute("""Select FAMILY,F_NAME from birthday where B_MONTH = '%s' AND B_DAY = '%s' """ % (currentMonth),%(currentDay)) this does not work, where did I go wrong?

this queryworks

cursor = conn.execute("""Select FAMILY,F_NAME from birthday where B_MONTH = '%s' """ % (currentMonth))

I cannot seem expand it to work using an AND clause to also include day as such:

cursor = conn.execute("""Select FAMILY,F_NAME from birthday where B_MONTH = '%s' AND B_DAY = '%s' """ % (currentMonth),%(currentDay))

this does not work, where did I go wrong?

Source Link

using current day and month in sql query in sqlite3

this queryworks; cursor = conn.execute("""Select FAMILY,F_NAME from birthday where B_MONTH = '%s' """ % (currentMonth))

I cannot seem expand it to work using an AND clause to also include day as such: cursor = conn.execute("""Select FAMILY,F_NAME from birthday where B_MONTH = '%s' AND B_DAY = '%s' """ % (currentMonth),%(currentDay)) this does not work, where did I go wrong?