Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: how to merge to datasets containing dates?


From   Andr� Paul <[email protected]>
To   [email protected]
Subject   st: how to merge to datasets containing dates?
Date   Sun, 15 Jan 2006 16:24:35 +0100

Dear all,

I have to datasets I would like to merge.

One of them contains a Firm ID and an application date (for a credit)
The other one contains the firm IDs + the starting and finishing dates of accounts +additional data(let's call them X).

I would like to merge both files by firm ID and dates, but the problem is that in the second data set I have a period (rather than a precise date) and I would like the application date to match the correct time period.
An example:

*data set 1

ID; date; credit number
1; 1 nov 2003; 1
1; 1 jan 2004; 2
1; 5 dec 2004; 3
2;
.
.

*data set 2

ID; starting date; finishing date; X
1; 1 oct 2003; 30 sep 2004; x1
1; 1 oct 2004; 30 sep 2005; x2
.
.

the merging process should give:

ID; date; credit number; X
1; 1 nov 2003; 1; x1
1; 1 jan 2004; 2; x1
1; 5 dec 2004; 3; x2

Does anyone have an idea about a way to solve this problem?
Thanks in advance,
Andr�

_________________________________________________________________
MSN Hotmail : cr�ez votre adresse e-mail gratuite & � vie ! http://www.imagine-msn.com/Messenger/?locale=fr-fr

*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/




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