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 |
|
esthera
Master Smack Fu Yak Hacker
1410 Posts |
Posted - 2005-08-29 : 04:21:17
|
| can someone help me adjust the following queryselect count(id) as hits from hits where [date] >= CONVERT(datetime, '8/28/2005', 101) AND [Date] < CONVERT(datetime, '8/29/2005', 101) and filesource=2I want to add to this that the ip of the hit (also in hits table) is unique from 12 midnight of the previous night |
|
|
Kristen
Test
22859 Posts |
Posted - 2005-08-29 : 06:55:57
|
| CONVERT(datetime, '8/28/2005', 101)The "format" 3rd parameter for CONVERT only works when converting from a datetime to text.You needSET DATEFORMAT mdySELECT ... where [date] >= CONVERT(datetime, '8/28/2005') ...Kristen |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-08-29 : 07:09:20
|
| Use Datetime variable to have that date and pass datevalue in yyyymmdd formatThen there wont be any need of conversionMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|