Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Need Ideas

Author  Topic 

osirisa
Constraint Violating Yak Guru

289 Posts

Posted - 2007-11-09 : 12:16:01
I have a table with 18,000 records with beg_eff_date since the year 2005. I need to separate the entries based on their daily activity. For example if Beg_eff_date 01/0/2005 then day is "1" if Beg_eff_date is 01/27/2005 then the day is "27".
Repeating the same process until I reach "NOW" present time. Any ideas of how can I do this?

Thank You for all your previous help and the current one!!

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2007-11-09 : 12:19:29
you need a datetime table:
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=61519

then left join your table to it on your date column.

_______________________________________________
Causing trouble since 1980
blog: http://weblogs.sqlteam.com/mladenp
SSMS Add-in that does a few things: www.ssmstoolspack.com
Go to Top of Page

osirisa
Constraint Violating Yak Guru

289 Posts

Posted - 2007-11-09 : 12:24:07
Please explain more in detail, how is it going to work. Is it going to ready line by line and separate the records?
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2007-11-09 : 12:26:55
emm.... it'll do a left join... i'm not sure what you mean by "how is it going to work".


_______________________________________________
Causing trouble since 1980
blog: http://weblogs.sqlteam.com/mladenp
SSMS Add-in that does a few things: www.ssmstoolspack.com
Go to Top of Page

osirisa
Constraint Violating Yak Guru

289 Posts

Posted - 2007-11-09 : 12:30:21
Is it going to separate the dates?
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2007-11-09 : 12:31:32
yes.

_______________________________________________
Causing trouble since 1980
blog: http://weblogs.sqlteam.com/mladenp
SSMS Add-in that does a few things: www.ssmstoolspack.com
Go to Top of Page

osirisa
Constraint Violating Yak Guru

289 Posts

Posted - 2007-11-09 : 13:07:47
I need to separate the entries daily for the month. Example all entries for the month of January 2005. Also, need to keep in mind the month. For example January have 31 days. But there are months with only 30 days. etc.
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-11-09 : 13:47:32
I still have absolutely no idea what you are trying to achieve.
How hard can it be to write properly what you want?

What do you mean with "separating" them? Are you talking about inserting a blank line in your reports between each month?



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2007-11-09 : 13:56:35
i think she needs to create a histogramic overview of the dates... or something...

_______________________________________________
Causing trouble since 1980
blog: http://weblogs.sqlteam.com/mladenp
SSMS Add-in that does a few things: www.ssmstoolspack.com
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2007-11-09 : 14:25:01
quote:
Originally posted by osirisa

Please explain more in detail, how is it going to work. Is it going to ready line by line and separate the records?



Yes it would be good if you could do that



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page
   

- Advertisement -