Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 2 / March 2007

Tip: Looking for answers? Try searching our database.

sort by date

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Greg S - 21 Mar 2007 17:08 GMT
I want to make a birthday list from my employee table that only shows the day
and month, not the year.  The dates were originally inputted to the table in
dd/mm/yyyy format.

Thanks!
Pat Hartman (MVP) - 21 Mar 2007 18:03 GMT
Dates can be formatted for display however you like.  Use the format
property of the control on the form or report to show just the month and day
if that's what you want.  For example to show Mar 21, place the following in
the format property of the birthday field:

mmm dd

>I want to make a birthday list from my employee table that only shows the
>day
[quoted text clipped - 3 lines]
>
> Thanks!
KARL DEWEY - 21 Mar 2007 18:44 GMT
To sort you would want the format like this --
   "mmdd  -  d mmmm"
Signature

KARL DEWEY
Build a little - Test a little

> Dates can be formatted for display however you like.  Use the format
> property of the control on the form or report to show just the month and day
[quoted text clipped - 10 lines]
> >
> > Thanks!
Pat Hartman (MVP) - 21 Mar 2007 18:49 GMT
To sort, you wouldn't use the formatted field at all you would sort on the
unformatted table field.  Notice I suggested formatting at the form/report
level rather than in a query.  It is when you format in your query that you
run into the sorting issue if you have formatted your date thereby turning
it into a text string.  Text strings sort character by character, left to
right (which is why October comes before February) whereas unformatted date
fields are sorted in numerical order.

> To sort you would want the format like this --
>    "mmdd  -  d mmmm"
[quoted text clipped - 17 lines]
>> >
>> > Thanks!
KARL DEWEY - 21 Mar 2007 19:00 GMT
I usually use two output fields - one for sort and the other for display.  In
my formating I used 2 digit month and two digit day to make it sort correctly.
Signature

KARL DEWEY
Build a little - Test a little

> To sort, you wouldn't use the formatted field at all you would sort on the
> unformatted table field.  Notice I suggested formatting at the form/report
[quoted text clipped - 25 lines]
> >> >
> >> > Thanks!
John W. Vinson - 21 Mar 2007 19:40 GMT
>I want to make a birthday list from my employee table that only shows the day
>and month, not the year.  The dates were originally inputted to the table in
>dd/mm/yyyy format.

I'd suggest using a calculated field:

HappyHappy: DateSerial(Year(Date()), Month([DOB]), Day([DOB]))

This will calculate this year's birthday anniversary; it can be sorted
chonologically to (e.g.) show a February 1952 birthday before a March 1985
birthday; and it can be formatted any way you like.

            John W. Vinson [MVP]
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.