473,545 Members | 2,063 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

48 New Member
I need to sort the "DateOfBirt h" 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_RptBirthday DC_Click()
On Error GoTo Err_btn_RptBirt hdayDC_Click

Dim stDocName As String

stDocName = "Rpt_Birthday_D C"
DoCmd.OpenRepor t stDocName, acPreview

Exit_btn_RptBir thdayDC_Click:
Exit Sub

Err_btn_RptBirt hdayDC_Click:
MsgBox Err.Description
Resume Exit_btn_RptBir thdayDC_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.
The result that I want to get is like below:
Where and how to sort the date by day? Can someone guide me thru? many thanks
Sep 21 '07 #1
3 2550
2,653 Recognized Expert Specialist
Hi, there.

Take a look at VBA function Day().
Sep 21 '07 #2
48 New Member
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
2,653 Recognized Expert Specialist
You are welcome.

Best regards,
Sep 25 '07 #4

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

Similar topics

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 to provide a listing of all table entries between 22:00 and 07:30 the next day, between a given set of dates (typically one week apart but in...
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 the dates in the db may be outside those input. Basically it's something like: select where input.startdate <= tbl.startdate or input.endate >=...
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 define what date range that is, restricting to a month period. I do not want to have to have to develop a lookup table for month and year. I was...
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: =InputBox("Enter Full Month and Year","Report Month",Format$(,"mmmm yyyy",0,0)) But this prompts with the date already filled in (August 2004). If I...
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 the end of the work they were hired to do or at the end of the project. Any employee may be hired, laid off and rehired several times during the...
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 year & month When I try to place a date filter 'Between x And y ' on an expression field
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 field? Many thanks as I'm totally lost on this.
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" portion of the Date is <= 15 (ie 1/1/2006 - 1/15/2006) it will populate a temp column with the actual month and year. However if the "day" portion...
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 standard letter from a report to each member regardless of the date they joined. Members are only supposed to receive letters an exact year after they...
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.