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 |
oracle_corrgi
Yak Posting Veteran
98 Posts |
Posted - 2006-09-13 : 01:26:52
|
hiSP with input parameters start_dte, end_dte, all1.If end_dte is not specified, then need to take today’s date_time.2.If start_dte is not specified, then need to take today’s date_time – 7 (to get data for last 7 days)3.‘All’ Boolean parameter, if yes, then need to send all data available in the system from beginning till date.thanxsdatabase |
|
timmy
Master Smack Fu Yak Hacker
1242 Posts |
Posted - 2006-09-13 : 01:32:54
|
Have I missed something, or has this site become RentACoder???? :-( |
 |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2006-09-13 : 01:49:00
|
quote: Originally posted by oracle_corrgi hiSP with input parameters start_dte, end_dte, all1.If end_dte is not specified, then need to take today’s date_time.2.If start_dte is not specified, then need to take today’s date_time – 7 (to get data for last 7 days)3.‘All’ Boolean parameter, if yes, then need to send all data available in the system from beginning till date.thanxsdatabase
What do you have so far ? KH |
 |
|
Kristen
Test
22859 Posts |
Posted - 2006-09-13 : 01:55:51
|
"2.If start_dte is not specified, then need to take today’s date_time – 7 (to get data for last 7 days)"Sounds pretty vague to me. 7 days from THE CURRENT TIME 7 days ago, or from midnight?And clearly Point 3 should be the First Point, otherwise it will never get executed. I actually think that an ALL parameter is nuts - the application can just set the start_dte to some ridiculously early date.Kristen |
 |
|
Kristen
Test
22859 Posts |
Posted - 2006-09-13 : 01:56:59
|
Should I refer to the "_dte" suffix as reverse-Hungarian-notation? |
 |
|
Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)
7020 Posts |
Posted - 2006-09-13 : 10:40:09
|
quote: Originally posted by oracle_corrgi hiSP with input parameters start_dte, end_dte, all1.If end_dte is not specified, then need to take today’s date_time.2.If start_dte is not specified, then need to take today’s date_time – 7 (to get data for last 7 days)3.‘All’ Boolean parameter, if yes, then need to send all data available in the system from beginning till date.thanxsdatabase
You might want to read about the GETDATE, DATEADD, and DATADIFF functions in Sql Server Books Online.If you need additional info, you may want to look through this:Date/Time Info and Script Linkshttp://www.sqlteam.com/forums/topic.asp?TOPIC_ID=64762CODO ERGO SUM |
 |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
|
|
|
|