Bind variables are supported in Automation. Do you have a variable activity above the Export Wizard activity?
I would suggest turinging on verbose logging (in Script Settings) and running again. This will give me an error stack to read. Then zip up your automation file and dependent files and email to me. I will take a look.
Okay, I had to do a bit of experimenting but got it to work for me.
There were two problems.
If you look in the log file the value being set has an extra quote in the middle of the date.
Variable value = 12/9/“2010 1:57:00 PM”
I don’t know why this is but it seems to only occur on Sybase. To handle this you need to have your select statement surround the date in quotes and convert the date to a string. Use a SQL something like the one below.
select ‘"’ + convert(char(10), max(ORDER_DATE), 101) + ‘"’ from QUEST_DEV.dbo.ORDERS
The export wizard doesn’t seem to like binds. I got the same null ref. However, the select to file works fine. I notice that you are exporting to tab delimited. Can you export to csv? The select to file will do this.
So to correct I would make a whole new script with the above changes. I attached my script for sample. If you need anything else you can send files to email@example.com