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.
Author |
Topic |
osirisa
Constraint Violating Yak Guru
289 Posts |
Posted - 2007-10-16 : 10:32:04
|
Good Morning Kristen:Thank You, You are the first person, that has given me a clear answer. I am going to explain in plain English What this SP is suppose to do. I have to find any station_nbr that has more than one group_code and that the current date = (DATEADD(mm,DATEDIFF(mm,0,dateadd(mm,-0-datepart(day,0),getdate())),0) The current date starts with the first day of the previous month. Example today is October 10, 2007 I need September 01, 2007 for this query. To insert the record it needs to be active meaning that the current date is in between Beg_eff_date and end_eff_date, and the end_eff_date is = ‘12/31/3000’I need to write SP(cursor) that reads line by line this table and that insert the answer: INSERT INTO #TP_TIES_OVerlaping_Dates. Example: Current_date: 09/01/2007 Group_Code Station_nbr beg_eff_date end_eff_date0000003 00371101 03/12/2006 12/31/30000000016 00371101 07/08/2007 12/31/3000The above explanation is for the first type of Error.The second Type of Error: If the Group Code ends with "W" and the End_effective_date = '12/31/3000' and the W_Beg_date is Part of the Temp Table(I to create the W_Beg_Date Column) -- is GREATER than the End_eff_date. I want to Insert this Record into the Table. I need to set sometype of Record Control to make the different between one error to another one. I thank you so much for your help.....I hope this is clear to understand for everybody. End |
|
Kristen
Test
22859 Posts |
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2007-10-16 : 10:51:32
|
Or is this Q-Bot inspired by K-Bot? Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
|
|
osirisa
Constraint Violating Yak Guru
289 Posts |
Posted - 2007-10-16 : 11:16:56
|
Ok. I thought about starting clean. Maybe I will have better luck getting a clear answer, plus the post was intended for you, since you were the only one yesterday, that gave me a clear answer of how to find the Sept. 01, 2007 date. Everybody else saw the syntax error but no one corrected it. Do you want to help me? Let me know, Thanks!!! |
|
|
osirisa
Constraint Violating Yak Guru
289 Posts |
Posted - 2007-10-16 : 11:18:18
|
The last post is intended for Kristen- Kristen Please let me know, if you can help me. Thanks!!! |
|
|
X002548
Not Just a Number
15586 Posts |
|
DonAtWork
Master Smack Fu Yak Hacker
2167 Posts |
Posted - 2007-10-16 : 12:48:09
|
And has a unit (most of the time, anyways) [Signature]For fast help, follow this link:http://weblogs.sqlteam.com/brettk/archive/2005/05/25.aspxLearn SQLhttp://www.sql-tutorial.net/ http://www.firstsql.com/tutor.htm http://www.w3schools.com/sql/default.asp |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2007-10-16 : 13:07:04
|
Locking this duplicate thread.Tara KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/ |
|
|
|
|
|
|
|