Search code examples
datespssformats

Date Formats In SPSS Script


    Dim SpssTextData As Variant
    Dim objDataDoc As ISpssDataDoc
    SpssTextData = objDataDoc.GetTextData("mydatecol", "mydatecol", 1, 1)

The result of SpssTextData should is of type Date but when when i read it it return a number ex: "12881203200" instead of "12/22/1990".

Apparently it is a format problem as explained in http://www.ats.ucla.edu/stat/spss/library/dates.htm in section "Formatting dates for display"


Solution

  • This was explained on the SPSS Community forums. This api does not return a formatted date: it returns the underlying numerical value.