format date values in spss export file

Dec 9, 2013 at 10:36 AM

I am exporting data from sql server to spss file using c#.
I have declare a datetime column as follows

SpssDateVariable v13 = new SpssDateVariable();
v13.Name = "FIELD_START";
v13.Label = "Field start date";

While exporting the output is coming as follows:
9-01-2008 0:00:0.0000

while we want the output as follows:

i have tried adding extra line as follows:
v13.WriteFormat = FormatTypeCode.SPSS_FMT_ADATE;

but it gives me following error:
SPSS function spssSetVarWriteFormat returned error code SPSS_INVALID_WRFOR

Any suggestions?
We are on fire.

Mar 25, 2014 at 1:42 PM
Dear Vicky,

Please see my post in issues for a solution (at least in my case).

Kind regards,