473,385 Members | 1,888 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

How to sort date regardless of month and year in query or report for Access 2000?

48
I need to sort the "DateOfBirth" by the day (dd) regarless of month (mm)and year (yyyy). I have a query called q_DC_Client, in criteria, I am using this code below:

Like "*" & "/" & [Forms]![F_DC_Birthday]![ComboBdayMonth] & "/" & "*"

I have a form called F_DC_Birthday with combo box called ComboBdayMonth. The combo takes information from T_Month table, where I only have two field, first field is the name of Month (eg, January, February...etc) and second field is 01 to 12. The code I use in form is as below:

[HTML]Private Sub btn_RptBirthdayDC_Click()
On Error GoTo Err_btn_RptBirthdayDC_Click

Dim stDocName As String

stDocName = "Rpt_Birthday_DC"
DoCmd.OpenReport stDocName, acPreview

Exit_btn_RptBirthdayDC_Click:
Exit Sub

Err_btn_RptBirthdayDC_Click:
MsgBox Err.Description
Resume Exit_btn_RptBirthdayDC_Click


End Sub[/HTML]

I can get report of clients who have birthday on particular month that I choose from the form, however, I need the report to sort clients according to the day. In report called Rpt_Birthday_DC, I had set Sorting and Grouping of the DateOfBirth to Ascending. It sort by the year follow by the month and then day.
20/10/1920
15/10/1932
28/10/1945
01/10/1950
The result that I want to get is like below:
01/10/1950
15/10/1932
20/10/1920
28/10/1945
Where and how to sort the date by day? Can someone guide me thru? many thanks
Sep 21 '07 #1
3 2542
FishVal
2,653 Expert 2GB
Hi, there.

Take a look at VBA function Day().
Sep 21 '07 #2
HowHow
48
Hi, there.

Take a look at VBA function Day().

Thank you! it works!
In query, I enter the code below in the field, set sort to ascending, and untick "show"

Expand|Select|Wrap|Line Numbers
  1. Expr 1: Day([DateOfBirth]) 
Sep 25 '07 #3
FishVal
2,653 Expert 2GB
You are welcome.

Best regards,
Fish
Sep 25 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

17
by: Lapchien | last post by:
My table has a record called date/time - filled (not surprisingly) with a date and time. I can format the date in one query field, also the time, using format in an expression. My user wants me...
2
by: B Briant | last post by:
I need to write an access query that will pull records from a table if the start or end dates input by the user are within the start and end dates in the db. I can't use BETWEEN because either of...
1
by: ED | last post by:
I currently have an ODBC query that hits an Oracle database. I want to bring back records for a given month based on a job completion date in the Oracle database. I would like to have the user...
4
by: Pea | last post by:
Hello, I have a nicely running report (thanks to Reggie and others) which I've been asked to modify to prompt for the Month (a monthly report to be run). I used an InputBox command: ...
13
by: Sue | last post by:
I'm working on a database that keeps track of employees hired by a general contractor on a project by project basis. These employees are hired to work on a project and are then laid off either at...
6
by: Tony Miller | last post by:
All I have an aggregate query using the function Month & Year on a datereceived field ie: TheYear: Year() TheMonth: Month() These are the group by fields to give me a Count on another field by...
13
by: Alan | last post by:
Hi Have asked before elsewhere but think I will have to rephrase the question. Using MS Access, what's the best way of tackling dates if I want to list all say; birthdays/birthdates in a date...
17
by: Mr.Kane | last post by:
Here's my dilemma. I am putting together a trend report using PivotCharts and so the query that I am trying to construct basically would look at the "Date_Entered" for a record and if the "day"...
2
by: LadySugar | last post by:
Greetings! I have a database in access that contains information about the date members joined the company. Every year, membership must be renewed for each member. Usually I will send out a...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.