There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
Search
Business Applications
Tag Cloud
access acer asus batch bios bsod computer crash desktop dns driver drivers error ethernet excel freeze gaming hard drive hardware hdmi internet laptop lcd malware memory monitor motherboard mouse network printer problem ram registry router security slow software sound trojan usb video virus vista wifi windows windows 7 windows 7 32 bit windows 7 64 bit windows xp wireless
Search
Search for:
Tech Support Guy Forums > Software & Hardware > Business Applications >
Solved: Access 2007 Future Date Query

Reply  
Thread Tools
joebell's Avatar
Computer Specs
Junior Member with 2 posts.
 
Join Date: Sep 2009
Experience: Intermediate
09-Sep-2009, 06:33 PM #1
Solved: Access 2007 Future Date Query
Hi Everyone,
I am trying to create a query that selects all records with a future date. The table that I am trying to select the records from is named "Events" and the field containing the date is "Date"
I am using Access 2007 and the date field is formated as 'Date/Time' data. I tried multiples ways, and even tried the 1000 year add date function pasted in below. Does anyone have any insights--I'm sure its something that is quite simple.

Thanks,
Joe

SELECT Events.Date, Events.Event
FROM Events
WHERE (((Events.Date)=DateAdd("yyyy",1000,Now())));
zhouma's Avatar
Member with 115 posts.
 
Join Date: Aug 2009
09-Sep-2009, 10:44 PM #2
Hi Joebell,

Try using Date() instead of Now(). As I know of Now() returns not only the computer's system/current date but also the computer's system/current time. This could be the problem.

Best,
Zhouma
OBP's Avatar
OBP OBP is offline
Computer Specs
Distinguished Member with 14,665 posts.
 
Join Date: Mar 2005
Location: UK
Experience: An old Basic Programmer
10-Sep-2009, 07:38 AM #3
Do you want the records from a single date to be returned or a range of dates?
If it is a range of dates use the Between dateone and datetwo function.
i.e. Between Date() and Date() + 365 gives the all the records between today and one years time.
If it is a single Date then use Date() + noofdays
i.e. Date() + 365 gives the date one year from now.
__________________
OBP
I do not give up easily
joebell's Avatar
Computer Specs
Junior Member with 2 posts.
 
Join Date: Sep 2009
Experience: Intermediate
10-Sep-2009, 02:47 PM #4
Hi Zhouma,
I switched 'now' to 'date' and it works! Thanks for your help. OBP: I was just trying to get records with a future date. I'll paste the working code below.

Joe


SELECT Events.Date, Events.Event, DateAdd("yyyy",1000,Date()) AS Expr1
FROM Events;
zhouma's Avatar
Member with 115 posts.
 
Join Date: Aug 2009
10-Sep-2009, 11:21 PM #5
You're welcome Joe Glad I was able to help
Reply

Tags
2007, access, date, future, query

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Search Tech Support Guy

Find the solution to your
computer problem!




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who want to help you solve your computer problems. See our Welcome Guide to get started.
Thread Tools



Facebook Facebook Twitter Twitter TechGuy.tv TechGuy.tv Mobile TSG Mobile
You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 02:55 PM.
Copyright © 1996 - 2011 TechGuy, Inc. All rights reserved.

Powered by Cermak Technologies, Inc.