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 |
|
gems
Starting Member
19 Posts |
Posted - 2007-04-11 : 10:04:11
|
| Hi,I have a datetime field in my table called start_date_time of type datetime. I created a parameter called @end_date in my stored procedure. The code looks something like thisstart_date_time <= @end_dateRight now if a user enters just date, computer picks up the current time from the PC clock and does not return records for that particular day after the time the query was run. So if a user enters end_date as 03/01/2007, it will return records for 03/01/2007 for only upto 10:00 am. I want it show records for the entire day. Is there a way that I can ignore the time part and just check the date value?I am using SQL server 2000.Thanks-G |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-04-11 : 10:06:12
|
trystart_date_time < dateadd(day, datediff(day, 0, @end_date), 1) KH |
 |
|
|
gems
Starting Member
19 Posts |
Posted - 2007-04-11 : 10:40:27
|
| Thanks KH. But it is still not working. |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-04-11 : 10:44:37
|
maybe you should post your table structure, some sample data and the required result. KH |
 |
|
|
gems
Starting Member
19 Posts |
Posted - 2007-04-11 : 11:14:59
|
| hey KH.. actually it is working fine if I run it in query analyzer but when I run my report in Crystal reports which uses this stored procedure, I don't get the right result. |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-04-11 : 11:17:23
|
Does it give you the right result if you run the stored procedure in QA ? KH |
 |
|
|
|
|
|
|
|