python error select analysis invalid expression for a number variable

Discussion created by louchios on Nov 11, 2013
Latest reply on Nov 12, 2013 by Wayne_Whitley
Hi I'm trying to do a select analysis with a number variable.

arcpy.Select_analysis(daily_stations, daily_stations_Select, "\"daily_YearMonthDay\" = x")

I've tried a number of different ways but keep getting errors. I obtained this code by building the select in modelbuilder and exporting to python. I replaced the number (20131105) that I used in modelbuilder with the variable x.

ERROR 000358: Invalid expression daily_YearMonthDay

Thank you