Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

st: First date


From   Keniajin Wambui <[email protected]>
To   [email protected]
Subject   st: First date
Date   Thu, 31 Jan 2013 14:31:00 +0300

I am using stataIC 12.1 64bit on windows 7.
I am calculating the first date the values for a given serial number
given was entered
The data example is

time_done    ndate_added    serialNumber    dfst
8:01:50 PM    26-Feb-09    88358        72127954
4:56:27 PM    27-Feb-09    88358        61004955
12:30:27 PM    25-Mar-09    88358        45044981
10:30:14 PM    02-Sep-12    88358        81033238


I am using the following code but its giving me (12:30:27 PM
25-Mar-09    88358)  as the first data to be entered but according to
the data (8:01:50 PM    26-Feb-09    88358) was the first to be
entered.

    gen double timefst=clock(time_done, "hms")
    replace timefst=clock(time_done, "hm") if timefst==.
    format timefst %tc
    format ndate_added %tc
    gen dfst=ndate_added + timefst
    egen double fdoadd = min(dfst), by(serialNumber)

how can I solve the problem

--
Mega Six Solutions
Web Designer and Research Consultant
Kennedy Mwai
254724211786
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index