Microsoft Access Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsDatabasesMicrosoft Access Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old March 11th, 2004, 09:01 AM
julianp julianp is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 1 julianp User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Parameter queries using Dates in Access

Iam tryingto usethe wizard on Access 2003 to generate a parameter query where all records are returned which fall between two dates i.e BETWEEN [Start Date] AND [End Date] The query works when I enter BETWEEN #01/03/2004# AND #03/03/2004# so I just need to know how to make dates between a parameter?

Thnx JP

Reply With Quote
  #2  
Old March 22nd, 2004, 11:17 AM
jangann jangann is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 6 jangann User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Date parameter example


Reply With Quote
  #3  
Old March 22nd, 2004, 11:18 AM
jangann jangann is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 6 jangann User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Or this:


Reply With Quote
  #4  
Old June 24th, 2012, 01:43 AM
Domenico Domenico is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2012
Posts: 1 Domenico User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 48 m 48 sec
Reputation Power: 0
Using Date parameters in criteria of a sub-query field

If you look for help on use of dates in Access query parameters, you'll see instructions to use #'s around the literal date, and just specify the date w/o #'s in response to a parameter in a criteria.

Example querying a date field:
using criteria >=#1/1/2010# works
using criteria >=[CutOffDate] and typing 1/1/2010 w/o the #'s when prompted for CutOffDate also works

However, if instead of specifying a criteria for a date field, you are specifying a criteria for a field which is the result of a sub-query, this will NOT work because Access does not automatically recognize that the sub-query field may be a Date data-type. So while this partially works (if you specify a literal date in the criteria: >=#1/1/2010#) it fails if you try to enter the date in response to a prompt for the parameter value.

Solution:
Force Access to convert the date string entered for the parameter value to a Date Value using a function.
use criteria >=DateValue([CutOffDate]) and enter the desired date w/o #'s when prompted for CutOffDate

Buongiorno!

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMicrosoft Access Development > Parameter queries using Dates in Access


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.

© 2003-2014 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap