Prev: Debug VB OCX and DLL
Next: COM Error 80110428 occurred
From: Jeff Johnson on 30 May 2007 10:51 "Max Kudrenko" <vb_mvp(a)hotmail.com> wrote in message news:1180533171.372556.213520(a)w5g2000hsg.googlegroups.com... >> > 2. Can I work with date part so a query like "... Where AdmDate between >> > '2007-05-28' and '2007-05-30' And..." will work without the need to add >> > hours and minutes (like "... Where AdmDate between '2007-05-28 >> > 00:00:00' >> > and '2007-05-30 23:59:59' And...")? >> >> 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. > > Why not just add a day without worrying about the time? That's one workaround, although it negates your ability to use BETWEEN.
From: Max Kudrenko on 30 May 2007 11:03 On May 30, 2:51 pm, "Jeff Johnson" <i...(a)enough.spam> wrote: > "Max Kudrenko" <vb_...(a)hotmail.com> wrote in message > news:1180533171.372556.213520(a)w5g2000hsg.googlegroups.com... > >> > 2. Can I work with date part so a query like "... Where AdmDate between > >> > '2007-05-28' and '2007-05-30' And..." will work without the need to add > >> > hours and minutes (like "... Where AdmDate between '2007-05-28 > >> > 00:00:00' > >> > and '2007-05-30 23:59:59' And...")? > > >> 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. > > > Why not just add a day without worrying about the time? > > That's one workaround, although it negates your ability to use BETWEEN. I do mean BETWEEN. Why "BETWEEN '2007-05-28' AND '2007-05-30 23:59:59'" is better than "BETWEEN '2007-05-28' AND '2007-05-31'" assuming that no entries for '2007-05-31 00:00:00' exist?
From: Steve Gerrard on 30 May 2007 11:09 "Jeff Johnson" <i.get(a)enough.spam> wrote in message news:ecU9$6roHHA.596(a)TK2MSFTNGP06.phx.gbl... > "Luiz Horacio" <lhoracio(a)iname.com> wrote in message > news:%23MIACjnoHHA.3264(a)TK2MSFTNGP04.phx.gbl... > > > 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)?
From: Bob Butler on 30 May 2007 11:26 "Max Kudrenko" <vb_mvp(a)hotmail.com> wrote in message news:1180537417.127788.135460(a)p47g2000hsd.googlegroups.com... > assuming that no entries for '2007-05-31 00:00:00' exist? Well, there's one reason
From: David Kerber on 30 May 2007 11:31
In article <1180537417.127788.135460(a)p47g2000hsd.googlegroups.com>, vb_mvp(a)hotmail.com says... > On May 30, 2:51 pm, "Jeff Johnson" <i...(a)enough.spam> wrote: > > "Max Kudrenko" <vb_...(a)hotmail.com> wrote in message > > news:1180533171.372556.213520(a)w5g2000hsg.googlegroups.com... > > >> > 2. Can I work with date part so a query like "... Where AdmDate between > > >> > '2007-05-28' and '2007-05-30' And..." will work without the need to add > > >> > hours and minutes (like "... Where AdmDate between '2007-05-28 > > >> > 00:00:00' > > >> > and '2007-05-30 23:59:59' And...")? > > > > >> 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. > > > > > Why not just add a day without worrying about the time? > > > > That's one workaround, although it negates your ability to use BETWEEN. > > I do mean BETWEEN. Why "BETWEEN '2007-05-28' AND '2007-05-30 > 23:59:59'" is better than "BETWEEN '2007-05-28' AND '2007-05-31'" > assuming that no entries for '2007-05-31 00:00:00' exist? That works fine, as long as you are sure that the extra second of included time won't mess up your results. I do it all the time. -- Remove the ns_ from if replying by e-mail (but keep posts in the newsgroups if possible). |