[AccessD] SQL between

O'Connor, Patricia (OTDA) Patricia.O'Connor at otda.state.ny.us
Fri Oct 26 16:25:05 CDT 2007


I stopped using the BETWEEN in all my queries using dates about 7 years
ago.  Doesn't matter to me what database  ORACLE, MS SQL, SYBASE,
ACCESS, ETC..   It is safer and more accurate to use.  This way I also
don't mess up going from one to another.

As I said in the query problem before it has to do with a date having
date/time.  A certain "time" during the day will not get selected when
just using a plain date in the where statement.  

WHERE tbldate > day_before_start_dt and tbldate < day_after_End_date
Where tbledate > '31-AUG-2005' and tbldate < '01-OCT-2005' 

What fun
Have a great weekend
Patti
**************************************************
* Patricia O'Connor
* Associate Computer Programmer Analyst
* OTDA - BDMA
* (W) mailto:Patricia.O'Connor at otda.state.ny.us
* (w) mailto:aa1160 at nysemail.state.ny.us
**************************************************
 

> 
--------------------------------------------------------
This e-mail, including any attachments, may be confidential, privileged or otherwise legally protected. It is intended only for the addressee. If you received this e-mail in error or from someone who was not authorized to send it to you, do not disseminate, copy or otherwise use this e-mail or its attachments.  Please notify the sender immediately by reply e-mail and delete the e-mail from your system. 


-----Original Message-----

> From: accessd-bounces at databaseadvisors.com 
> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of John Bartow
> Sent: Friday, October 26, 2007 03:38 PM
> To: _DBA-Access
> Subject: [AccessD] SQL between
> 
> I have recently found a couple of issues in an app converted 
> from A97 to A2k3. The items of questions worked in A97 but 
> fail in A2k3.
> 
> Problem 2. )
> 
> (Well, I guess this is more of a heads up.)
> 
> SQL between is not inclusive. So now I have to do a between 
> DATE1 -1 and between DATE2 +1
> 
>  
> 
> BTW I've always though it odd that it was inclusive but it 
> seems to be many of the SQL products but not in others. Standards!?
> 
> 
> 
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
> 
>





More information about the AccessD mailing list