[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
Re: st: Re: Cannot get date fields to import from PostgreSQL via ODBC
-----BEGIN PGP SIGNED MESSAGE-----
On Monday, 26.09.2005 at 14:20 -0500, Kevin Crow - StataCorp wrote:
> You might want to try the -allstring- option of the -odbc load-
> [snip details]
Ah, interesting: that certainly appears to work, in the sense that it
reads in the dates as strings.
However, this doesn't actually give you 'proper' date variables, does
it? I realise one can string-splice to pull out the components of the
date, but that's rather tedious. Also, it looks like -datestring- is a
better option than -allstring-, otherwise other numeric variables are
imported unnecessarily as strings (although there weren't any of those
in my example, there *are* in the 'real' database).
Regarding Stata versions: at the time I posted my original message, I
Stata executable: 05 Jul 2005
Ado-file updates: 05 Jul 2005
After running 'update all' etc., I get this:
Stata executable: 15 Sep 2005
Ado-file updates: 19 Sep 2005
There did not appear to be any odbc-related updates in the list of ADOs
that were downloaded. In any case, the behaviour of the incorrectly
importing dates remains unchanged after testing again with the new,
Can you suggest a way to 'transparently' import these dates as 'proper'
date variables? Or at least a way to easily re-type the imported
strings as dates?
Thanks for your help so far, Kevin.
Computing Manager, Cancer Epidemiology Unit
Cancer Research UK / Oxford University
PGP: CC70 1883 BD92 E665 B840 118B 6E94 2CFD 694D E370
Get key from http://www.ceu.ox.ac.uk/~davee/davee-ceu-ox-ac-uk.asc
N 51.7518, W 1.2016
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
-----END PGP SIGNATURE-----
* For searches and help try: