'Todays' Date in Query (1 Viewer)

Felony

New member
Local time
Today, 13:11
Joined
Feb 3, 2005
Messages
8
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
 
Local time
Today, 06:11
Joined
Aug 2, 2004
Messages
272
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 :cool:
 

Felony

New member
Local time
Today, 13:11
Joined
Feb 3, 2005
Messages
8
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. >_<
 

Users who are viewing this thread

Top Bottom