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 |
|
Pinto
Aged Yak Warrior
590 Posts |
Posted - 2005-05-05 : 11:14:10
|
| I am making a the value on my asp.net web page today's date less 60 days like thisMe.txtDateFrom.Text = DateAdd("d", -60, Today)I am then using this value to select all calls with Call_date after this date. Like this (this is just part of my sql, the rest works ok)strSQL = strSQL + " and Call_date >= " + CDate(strDateFrom)However, it ignores this selection and still returns all dates.I feel this has something to do with fact that the time is stored also in Call_date ie 10/04/2005 10:10:05But how do I overcome this ?TIA |
|
|
cshah1
Constraint Violating Yak Guru
347 Posts |
Posted - 2005-05-05 : 11:38:28
|
| I assume call_Date is a sQL datetime fieldtry this..strSQL = strSQL & " and Call_date >= '" & DateAdd("d", -60,CDate(strDateFrom)) & "'" |
 |
|
|
jsmith8858
Dr. Cross Join
7423 Posts |
Posted - 2005-05-05 : 12:19:09
|
| make sure there are also no OR operators in the rest of your WHERE clause that are not properly parenthesized. (is that a word?)- Jeff |
 |
|
|
Pinto
Aged Yak Warrior
590 Posts |
Posted - 2005-05-06 : 05:25:26
|
Thanks cshah1 - that worked fine |
 |
|
|
|
|
|