Connecting Tech Pros Worldwide Help | Site Map

Ordering fields in query based on current date

 
LinkBack Thread Tools Search this Thread
  #1  
Old November 13th, 2005, 01:28 PM
Smriti Dev
Guest
 
Posts: n/a
Default Ordering fields in query based on current date


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





  #2  
Old November 13th, 2005, 01:28 PM
lesperancer@natpro.com
Guest
 
Posts: n/a
Default Re: Ordering fields in query based on current date

what is your current query

  #3  
Old November 13th, 2005, 01:28 PM
PC Datasheet
Guest
 
Posts: n/a
Default 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]


  #4  
Old November 13th, 2005, 01:28 PM
Larry Linson
Guest
 
Posts: n/a
Default 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


 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,840 network members.