[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: AW: Data transfer woes

From   "Martin Weiss" <>
To   <>
Subject   st: AW: Data transfer woes
Date   Wed, 24 Jun 2009 09:40:38 +0200


Does this example address your problem?

inp str20 date
"19mar2009 23:59:43"
gen date2=date(date, "DMYhms")
format date2 %td
l, noobs


-----Ursprüngliche Nachricht-----
[] Im Auftrag von Clemens P.
Gesendet: Mittwoch, 24. Juni 2009 09:12
Betreff: st: Data transfer woes


I am new to STATA and I am having a problem with date fields when 
transferring data from SQL Server to STATA 10 format using StatTransfer 9.

In the database the date fields are specified as Date, not DateTime.  
When I do the transfer the fields come out as long with format %tc. When 
I browse the data I see "19mar2009 23:59:43".

My programs depend on the field to be of the form %td, as in "19mar2009" 
and thus my programs break!  I try changing the format to %td and when I 
brows the data as see 1.454e+12.

I notice that usually date fields are of the type float and changing 
/setting the format to %td gives me what i need

Could someone please help me by telling me what I am doing wrong.

Kind regards,

*   For searches and help try:

*   For searches and help try:

© Copyright 1996–2022 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index