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 |
|
TJ
Posting Yak Master
201 Posts |
Posted - 2003-10-09 : 12:36:15
|
I'm using SQL7. I have stored procedures that select recordsets for Crystal reports. I need to add two input parameters to the sprocs to add to the where clause for the record selection. create procedure Rec_Detail @begdte as smalldatetime, @enddte as smalldatetime ASbegin select acctnum, amount, trantype, trandate, FROM tbl1 WHERE ACCTNUM < = '999999999' AND trandate between @begdte and @enddteend My issue with this is the time. I want everything between the beginning and the ending date regardless of the timestamp. Any suggestions would be appreciated.Thanks!Teresa"It's not what you take with you when you go; but what you leave behind you when you're gone." |
|
|
Page47
Master Smack Fu Yak Hacker
2878 Posts |
Posted - 2003-10-09 : 12:38:05
|
| ...WHERE ACCTNUM < = '999999999' ANDtrandate >= dateadd(dd,datediff(dd,0,@begdte),0) andtrandate < dateadd(dd,datediff(dd,0,@enddte)+1,0)Jay White{0} |
 |
|
|
TJ
Posting Yak Master
201 Posts |
Posted - 2003-10-09 : 12:45:35
|
quote: Originally posted by Page47 ...WHERE ACCTNUM < = '999999999' ANDtrandate >= dateadd(dd,datediff(dd,0,@begdte),0) andtrandate < dateadd(dd,datediff(dd,0,@enddte)+1,0)Jay White{0}
THANK YOU!!! That works great!Sincerely,Teresa |
 |
|
|
|
|
|
|
|