Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 12th, 2015, 01:01 PM
Registered User
 
Join Date: Feb 2015
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Query date/time field for values between yesterday at 15:31 and today at 15:30?

How do I write criteria to query a date/time field for values that fall between yesterday at 15:31 and today at 15:30? Every option I try generates invalid date field, invalid data type or invalid syntax errors.

I've tried:
between "#"+Format(Date()-1,"mm/dd/yyyy")+" 3:31 PM#" and "#"+Format(Date(),"mm/dd/yyyy")+" 3:30 PM#"

between #Format(Date()-1,"mm/dd/yyyy")+" 3:31 PM"# and #Format(Date(),"mm/dd/yyyy")+" 3:30 PM"#

between #Format(Date()-1,"mm/dd/yyyy") 3:31 PM# and #Format(Date(),"mm/dd/yyyy") 3:30 PM#

and other combinations using CDate or CDbl ... anything to try to corerce a date time field. But nothing works.

Any ideas? Somebody else has had to compare between relative dates and times.





Similar Threads
Thread Thread Starter Forum Replies Last Post
CH 30-15: Could not load type 'NorthwindDataContext'. EDGY BOOK: Professional ASP.NET 4 : in C# and VB 1 September 14th, 2013 06:50 AM
Professional 30-15 error EDGY BOOK: Beginning ASP.NET 4 : in C# and VB 0 September 13th, 2013 07:50 PM
listing 15-15 pg(568) DyerOppenheimer BOOK: Professional ASP.NET 2.0 and Special Edition; ISBN: 978-0-7645-7610-2; ISBN: 978-0-470-04178-9 0 February 13th, 2008 01:41 PM
Ch 15 Register.asp query daveyarwood BOOK: Beginning ASP 3.0 0 July 16th, 2005 12:52 PM
Date query pulling records from yesterday Justine Access 5 June 27th, 2004 03:45 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.