By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,361 Members | 1,345 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,361 IT Pros & Developers. It's quick & easy.

Data conversion

P: 1
I have a view with employee type history.
EmployeeID | EmployeeTypeTitle | EmployeeStartDate
1 | trial | 2007-09-01
1 | regular | 2008-03-01
2 | trial | 2007-11-01

But now I need the data in a different format, with every month on a single row. Like this
EmployeeID | Period | EmployeeTypeTitle
1 | 200709 | trial
1 | 200710 | trial
1 | 200711 | trial
1 | 200712 | trial
1 | 200801 | trial
1 | 200802 | trial
1 | 200803 | regular
2 | 200711 | trial
2 | 200712 | trial
2 | 200801 | trial
2 | 200802 | trial
2 | 200803 | trial

I hope this make any sense.
Mar 27 '08 #1
Share this Question
Share on Google+
2 Replies


jamesd0142
100+
P: 469
Theres no simple solution to this as far as i can see, i think it needs to be choped up with some reasonably complex code.
Mar 27 '08 #2

ck9663
Expert 2.5K+
P: 2,878
What happens next month, 200804? How would your table look like? Will you still add a record for your EmployeeID = 1? Do you add another record for EmployeeID=2? Or before cut-off/processing day, a new record will be inserted if employee becomes regular? After that cut-off day, whatever is on the table will be processed?

-- CK
Mar 27 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.