I am new to Access and was hoping someone could help me with a question. On a report or form you can place "=Date()" in a text box to display the current date, is there a way to have it display the dates of the current week, Sunday - Saturday?
thanks,
Jeff
9 1559
Hi Jeff
Welcome to TheScripts family.
Feel free to post questions in the related forum only by choosing from under the blue bar on the top of your page.
Please follow the posting guidelines in every new post/reply.
Please specify your post/question clearly.Please use proper code tags in all your codes.
Regards
Debasis
I am new to Access and was hoping someone could help me with a question. On a report or form you can place "=Date()" in a text box to display the current date, is there a way to have it display the dates of the current week, Sunday - Saturday?
thanks,
Jeff
try this...
=Date()-Weekday(Date())+3
this will give you tuesday of the current week
Wed +4
Thur +5
Fri +6
Next Mon +9
For the start and ending dates of the week: - Date() - (Weekday(Date()) - 1) & " - " & Date() - Weekday(Date()) + 7
Welcome to TheScripts!
Linq ;0)>
Thanks for the replies, works great. Just the help I needed.
thanks again,
Jeff
Glad we could help!
Linq ;0)>
For the start and ending dates of the week: - Date() - (Weekday(Date()) - 1) & " - " & Date() - Weekday(Date()) + 7
Welcome to TheScripts!
Linq ;0)>
How would I write this to display the dates of the current month or the previous month?
thanks,
Jeff
If you mean the first and last of the current month and first and last of the previous month:
'First of the current month
DateSerial(Year(Date), Month(Date), 1)
'Last of the current month
DateSerial(Year(Date), Month(Date) + 1, 0)
'First of the previous month
DateSerial(Year(Date), Month(Date) - 1, 1)
'Last of the previous month
DateSerial(Year(Date), Month(Date), 0)
Linq ;0)>
If you mean the first and last of the current month and first and last of the previous month:
'First of the current month
DateSerial(Year(Date), Month(Date), 1)
'Last of the current month
DateSerial(Year(Date), Month(Date) + 1, 0)
'First of the previous month
DateSerial(Year(Date), Month(Date) - 1, 1)
'Last of the previous month
DateSerial(Year(Date), Month(Date), 0)
Linq ;0)>
Works perfectly.
Thank you,
Jeff
Glad we coul help again!
Linq ;0)> Sign in to post your reply or Sign up for a free account.
Similar topics
by: Greg Iocco |
last post by:
Simple problem, but I've checked the newsgroups and couldn't find an
answer.
On the main swithboard is a command button to open a report. The
report I built is based off a query, and the query...
|
by: Michelle |
last post by:
Hi all
I have a report which displays staff absences. An absence record has
a start and end date and the type of absence, ie sickness, annual
leave.
I have created a form which allows the...
|
by: Rene |
last post by:
I have a master "attendance" report that also has two "attendance"
sub-reports...each collecting data from a different group...and
totaling
those present at the end. I chose sub-reports because...
|
by: manning_news |
last post by:
Using A2K. I've been asked to modify a report currently requiring only
one date parameter to now accept a date range. The main report has 2
subreports and is not bound to a table or query. The...
|
by: nishkrish |
last post by:
Hi,
I am new to access
I created the form and report from Allen Browne's Frmwhat Date the way
he
has described but when i preview report it shows
StartDate: name?
Enddate: name?
am i suppose...
|
by: keithsimpson3973 |
last post by:
I have a program built in Visual Basic 6. It uses an Access 2003 database. My report selection form in vb6 has 2 date pickers for start date and end date. The report is an Access report. When the...
|
by: creative1 |
last post by:
Hello everyone.
I am experiencing a strange problem that I can't fix on my own. I think I need expert's suggestions for this.
The problem is:
I want to print account statement (or any other...
|
by: kmnotes04 |
last post by:
Could anyone tell me how to restrict the date range for items that
appear on a report? Old items from previous years appear on the
report. I was asked to have only this year's items (and beyond)...
|
by: Fred's |
last post by:
Hi Folks,
I have a report which the record source is a query name: Query3 and in
my Query3 I have this parameter "between And ".
Therefore, when I open my report, it will ask for a Start Date...
|
by: smithj14 |
last post by:
I have a form to enter start and end dates then select a worker name to filter a report. This all works fine and when the report is open in preview mode it shows the date range in the txtboxes on the...
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
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...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
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
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
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,...
| |