Go Back   Access World Forums > Microsoft Access Discussion > Queries

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 02-03-2005, 03:07 PM   #1
Felony
Registered User
 
Join Date: Feb 2005
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Felony is on a distinguished road
'Todays' Date in Query

Hi everyone, I hope I've done this correctly.

I'll break down what I'm planning on doing ::

I'm creating a Doctor's Surgeory database, in which I want to run a query which will bring up a list of appointments for a certain doctor each day. Now I can do this, but I want to use 'todays' date, without someone having to type it in. So this was my plan. Create a form which popped up when the file loaded, which would ask for 'todays' date. Then when you clicked "ok", it would close that, save it in a table, and open my main Form. I did that, so that isn't a problem. My problem is that, how can I make a query use the data in the Date table, so that when the query is clicked, it always comes up with the date put in at the start, when the programme loaded? So say if I typed in that todays date was "03/02/2005", and there were five appointments for that day with Dr. Fred, then I want to be able to only make those five come up when the query is run.

Now, I couldn't come up with a better way to get 'todays' date, however maybe there is a better way? And my problem is probably an easily answered one, but I couldn't work it out earlier, so I thought I'd ask for some advise from somewhere.


Thanks to anyone who answers, or in fact even reads, and tries to help.


Take care,
Felony

Felony is offline   Reply With Quote
Old 02-03-2005, 03:13 PM   #2
sfreeman@co.mer
Sam_F
 
sfreeman@co.mer's Avatar
 
Join Date: Aug 2004
Posts: 272
Thanks: 0
Thanked 0 Times in 0 Posts
sfreeman@co.mer is on a distinguished road
In the date criteria for your query just use the built in function 'Date()', which will give you today's date.

SQL should resemble:

SELECT
tblDate.DateField

FROM
tblDate

WHERE
(((tblDate.DateField)=Date()));

HTH
__________________
90% of the problem is asking the right question.
sfreeman@co.mer is offline   Reply With Quote
Old 02-03-2005, 03:27 PM   #3
Felony
Registered User
 
Join Date: Feb 2005
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Felony is on a distinguished road
Thanks. I'll check that out tomorrow, or whenever I have chance. And I think I tried the 'Date()' thing, is that all you're supposed to type in? And ouch, I've never really touched SQL before - Haha. I actually suck quite badly with Access (well compared to most people here), but it's all good.

I also wish that I had a copy of Access here with me, now. >_<

Felony is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump




All times are GMT -8. The time now is 03:11 PM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World