[AccessD] Date-scoping

papparuff at comcast.net papparuff at comcast.net
Wed Aug 29 09:23:22 CDT 2007


I've always had problems with getting records based on a range of dates until I changed me methodology. I look for those dates that are greater than the date before the actual start date and the dates that are less the the date after the last date. This way I always include the start date beginning at midnight and the last date ending at 11:59.59.

So I would do this:

TransactionDate > dateadd("d",-1,StartDate) AND TransactionDate < dateadd("d",+1,EndDate)

papparuff
--
John V. Ruff – The Eternal Optimist :-) 

“Commit to the Lord whatever you do, 
and your plans will succeed.” Proverbs 16:3

-------------- Original message -------------- 
From: "Rocky Smolin at Beach Access Software" <rockysmolin at bchacc.com> 

> 
> Arthur: 
> 
> I'd try: TransactionDate >= #03-Jul-07# AND TransactionDate <= #03-Jul-07# 
> 
> Will the two dates always e the same or will there mostly be a range. Also, 
> try removing the date filter to see what's being returned. Could it be that 
> there are no records with July 3, 07? 
> 
> Rocky 
> 
> -----Original Message----- 
> From: accessd-bounces at databaseadvisors.com 
> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Arthur Fuller 
> Sent: Wednesday, August 29, 2007 3:38 AM 
> To: Access Developers discussion and problem solving 
> Subject: [AccessD] Date-scoping 
> 
> It's been a long while since I've done an MDB-BE and it's amazing how much 
> one forgets. I'm trying to date-scope a report. I've got a little form that 
> asks for start and end dates, and the result is being passed in like this: 
> 
> (TransactionTypeID= 2 AND TransactionDate BETWEEN #03-Jul-07# AND 
> #03-Jul-07#) 
> 
> This is not working. What am I doing wrong? 
> 
> TIA, 
> Arthur 
> -- 
> AccessD mailing list 
> AccessD at databaseadvisors.com 
> http://databaseadvisors.com/mailman/listinfo/accessd 
> Website: http://www.databaseadvisors.com 
> 
> -- 
> AccessD mailing list 
> AccessD at databaseadvisors.com 
> http://databaseadvisors.com/mailman/listinfo/accessd 
> Website: http://www.databaseadvisors.com 
> 
> No virus found in this incoming message. 
> Checked by AVG Free Edition. 
> Version: 7.5.484 / Virus Database: 269.12.10/977 - Release Date: 8/28/2007 
> 4:29 PM 
> 
> 
> -- 
> 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