Possible bug? Probably solved.


Hi there,

First of all: this tool is extremely helpful and functions very well. For quite some time though, I've been struggling with formatting Dates in the SPSS output. We kept getting errors like "INVALID WRFORMAT" or "INVALID PRFORMAT". Therefore, we were always confronted with the inconvenient DATETIME format in our SPSS files: dd-mmm-yyyy 00:00:00:000.

After implementing the C# code (at first, we only used the dll), I finally found why we weren't able to change the date format. The problem lies in the two lines of code where the PrintFormat and WriteFormat are set in SpssDateVariable.cs, lines 184 and 185. The spssSetVarPrintFormat and spssSetVarWriteFormat are called with as fourth variable (printDec) value "4". I assumed printDec states how many decimals are to be shown. So I changed this value to "0" (in both lines of codes) and the problem seems to be solved. Now, we can finally alter the dateformat :)

I hope this was helpful.

Kind regards,



yuanyesong wrote Jul 20, 2015 at 10:39 AM

Thanks Dirk! Great, it worked.