Publishing a GP service with a date variable issue.

Discussion created by angelg on Aug 13, 2012
Latest reply on Sep 7, 2014 by pml
I have a mxd with a sewer feature class and a  sql table which I joined.  Using modelbuilder I did a  SelectLayerByAttribute where by the user input  two dates, as part of the modelbuilder parameters, which work correctly within model builder when run. The date  field is with the table (not on the Sewer layer). When the tool is run from the toolbox is is also working correctly.   Yet when I published and then try to run the tool from the server I get a invalid SQL error message ( see sql1.jpg)

The expression below is what is used by SelectLayerByAttribute tools. I am thinking that sql does not like the "date" that is required to run the selection in modelbuilder.

TL_DT_INSP >= date '%Start Date%'   and TL_DT_INSP <= date '%End Date%'   and gbagis.GBA.SWNETG.OBJECTID > 0

Any clues as to how I might publish a tool without the "date"?