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 |
|
duanecwilson
Constraint Violating Yak Guru
273 Posts |
Posted - 2009-08-13 : 10:31:27
|
| This works: select dateadd(second, -1, dateadd(day, 1, convert(datetime, '01/02/2009', 112 )))This does not: select dateadd(second, -1, dateadd(day, 1, convert(datetime, '01/02/2009', 112 )))I want someone to be able to use the second format. Any ideas?Duane |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2009-08-13 : 10:34:47
|
Don't used closed datetime filter searches. Use Open-Ended, like this!SELECT *FROM Table1WHERE Col1 >= '20090517' AND Col1 < '20090518'to get ALL records dated for 17th of May 2009 in Col1 column. N 56°04'39.26"E 12°55'05.63" |
 |
|
|
rocknpop
Posting Yak Master
201 Posts |
Posted - 2009-08-13 : 10:37:00
|
| select dateadd(second, -1, dateadd(day, 1, convert(datetime, '20091201', 112 )))--------------------Rock n Roll with SQL |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2009-08-13 : 10:40:46
|
Rock'N'Pop, what to do with the records dated 20091201 23:59:59.500 ? N 56°04'39.26"E 12°55'05.63" |
 |
|
|
duanecwilson
Constraint Violating Yak Guru
273 Posts |
Posted - 2009-08-13 : 10:45:37
|
| I appreciate all the ideas here. I am learning.Duane |
 |
|
|
rocknpop
Posting Yak Master
201 Posts |
Posted - 2009-08-13 : 10:45:48
|
| Yes Peso, as you mentioned open-ended search is the best solution for such a problem. I did not think logically. Thanks for that.--------------------Rock n Roll with SQL |
 |
|
|
|
|
|
|
|