Prev: Debug VB OCX and DLL
Next: COM Error 80110428 occurred
From: Jeff Johnson on 30 May 2007 13:37 "Steve Gerrard" <mynamehere(a)comcast.net> wrote in message news:C9mdnclfjM0UDsDbnZ2dnUVZ_r-onZ2d(a)comcast.com... >> Nope. It's just a fact of life. You'd think after so many iterations of >> SQL Server and the like that there would be built-in functions for this >> but there aren't. We all have to tack on the 11:59:59 PM, so welcome to >> the club. > > No equivalent to Oracle's Trunc(MyDateTime)? Sounds like that's exactly what I've been looking for for a long time. Too bad SQL Server doesn't have it.
From: Jeff Johnson on 30 May 2007 13:39 "Bob Butler" <noway(a)nospam.ever> wrote in message news:OkVKy7soHHA.3944(a)TK2MSFTNGP02.phx.gbl... >> assuming that no entries for '2007-05-31 00:00:00' exist? > > Well, there's one reason Exactly. And I KNEW I was going to get that reply, too. I knew it! 99.999999999999999999999999999999999999999% <> 100% Ever. Sometimes things really are black and white.
From: Tony Proctor on 30 May 2007 14:34 So what's wrong with using normal relational operators instead of BETWEEN, e.g. SELECT * FROM MyTable WHERE MyDate >= '2007-05-28' AND MyDate < '2007-05-31' Note the use of '<' against the end date Tony Proctor "Jeff Johnson" <i.get(a)enough.spam> wrote in message news:uNi8oEuoHHA.2596(a)TK2MSFTNGP06.phx.gbl... > "Bob Butler" <noway(a)nospam.ever> wrote in message > news:OkVKy7soHHA.3944(a)TK2MSFTNGP02.phx.gbl... > > >> assuming that no entries for '2007-05-31 00:00:00' exist? > > > > Well, there's one reason > > Exactly. And I KNEW I was going to get that reply, too. I knew it! > > 99.999999999999999999999999999999999999999% <> 100% > > Ever. Sometimes things really are black and white. > >
From: Bob Butler on 30 May 2007 14:40 "Tony Proctor" <tony_proctor(a)aimtechnology_NoMoreSPAM_.com> wrote in message news:Of2OpkuoHHA.208(a)TK2MSFTNGP05.phx.gbl... > So what's wrong with using normal relational operators instead of BETWEEN, > e.g. > > SELECT * FROM MyTable WHERE MyDate >= '2007-05-28' AND MyDate < > '2007-05-31' > > Note the use of '<' against the end date That's how I usually do it (although it's mostly that I never remember with 100% confidence if Between is inclusive or not and am too lazy to check)
From: Robert Morley on 30 May 2007 14:51
You'd want to check with someone who's more "up" on the internals of modern database optimization, but I suspect that a database might well be able to better optimize a BETWEEN clause than it would using the "normal" relational operators. Personally, I've always felt that BETWEEN was missing as a relational operator in most languages, simply because you're specifying the same variable twice for what is conceptually one comparison ("is x in this range?"), even if it might well get boiled down to two distinct comparisons at the low level. It's kind of like using an IN() or the simple Select Case operator...the variable gets specified once ("is x in this set?"), even though the number of comparisons may be greater. Rob "Tony Proctor" <tony_proctor(a)aimtechnology_NoMoreSPAM_.com> wrote in message news:Of2OpkuoHHA.208(a)TK2MSFTNGP05.phx.gbl... > So what's wrong with using normal relational operators instead of BETWEEN, > e.g. > > SELECT * FROM MyTable WHERE MyDate >= '2007-05-28' AND MyDate < > '2007-05-31' > > Note the use of '<' against the end date > > Tony Proctor > > "Jeff Johnson" <i.get(a)enough.spam> wrote in message > news:uNi8oEuoHHA.2596(a)TK2MSFTNGP06.phx.gbl... >> "Bob Butler" <noway(a)nospam.ever> wrote in message >> news:OkVKy7soHHA.3944(a)TK2MSFTNGP02.phx.gbl... >> >> >> assuming that no entries for '2007-05-31 00:00:00' exist? >> > >> > Well, there's one reason >> >> Exactly. And I KNEW I was going to get that reply, too. I knew it! >> >> 99.999999999999999999999999999999999999999% <> 100% >> >> Ever. Sometimes things really are black and white. >> >> > > |