format date values in spss export file

Dec 9, 2013 at 11:36 AM
Hi,

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";
doc.Variables.Add(v13);

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

while we want the output as follows:
1/09/2008

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.

Regards
Mar 25, 2014 at 2:42 PM
Dear Vicky,

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

Kind regards,

Dirk