Connecting Tech Pros Worldwide Forums | Help | Site Map

Ordering fields in query based on current date

Smriti Dev
Guest
 
Posts: n/a
#1: Nov 13 '05

Hi There,

I'm creating a form based on query and I want the appointments to be ordered
from top to bottom with the top appointments being closest to the currrent
date.
How can i set this up in my query?


I do appreciate your help with this.

Thanks,
Smriti





lesperancer@natpro.com
Guest
 
Posts: n/a
#2: Nov 13 '05

re: Ordering fields in query based on current date


what is your current query

PC Datasheet
Guest
 
Posts: n/a
#3: Nov 13 '05

re: Ordering fields in query based on current date


If you don't want to show future appointments, set the criteria of the
AppointmentDate field to <=Date(). To order the appointments starting with
the most current appointment, set the sort for Appointment to descending.

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
resource@pcdatasheet.com
www.pcdatasheet.com


"Smriti Dev" <smriti.dev@utoronto.ca> wrote in message
news:IMGJ0K.K7x@campus-news-reading.utoronto.ca...[color=blue]
>
> Hi There,
>
> I'm creating a form based on query and I want the appointments to be
> ordered
> from top to bottom with the top appointments being closest to the currrent
> date.
> How can i set this up in my query?
>
>
> I do appreciate your help with this.
>
> Thanks,
> Smriti
>
>
>
>[/color]


Larry Linson
Guest
 
Posts: n/a
#4: Nov 13 '05

re: Ordering fields in query based on current date


"Smriti Dev" wrote
[color=blue]
> I'm creating a form based on query
> and I want the appointments to be
> ordered from top to bottom with
> the top appointments being closest
> to the currrent date.[/color]

Are you showing only future appointments? If so, in the Query Builder,
select Ascending in the Sort line under the date / time field of the
appointment. (And, I feel obligated to mention, that field should not be
named Date, because date is an Access reserved word.)

If you are showing appointments that are already past _and_ in the future,
you will have to come up with a different display scheme, something like
using the ABSolute of the DateDiff, if that gives you what you want.

Larry Linson
Microsoft Access MVP


Closed Thread


Similar Microsoft Access / VBA bytes