By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,466 Members | 2,523 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,466 IT Pros & Developers. It's quick & easy.

Date on a report or form

P: 46
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
Mar 20 '08 #1
Share this Question
Share on Google+
9 Replies


debasisdas
Expert 5K+
P: 8,127
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
Mar 20 '08 #2

P: 1
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
Mar 21 '08 #3

missinglinq
Expert 2.5K+
P: 3,532
For the start and ending dates of the week:

Expand|Select|Wrap|Line Numbers
  1. Date() - (Weekday(Date()) - 1) & " - " & Date() - Weekday(Date()) + 7
Welcome to TheScripts!

Linq ;0)>
Mar 21 '08 #4

P: 46
Thanks for the replies, works great. Just the help I needed.

thanks again,

Jeff
Mar 22 '08 #5

missinglinq
Expert 2.5K+
P: 3,532
Glad we could help!

Linq ;0)>
Mar 23 '08 #6

P: 46
For the start and ending dates of the week:

Expand|Select|Wrap|Line Numbers
  1. 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
May 3 '08 #7

missinglinq
Expert 2.5K+
P: 3,532
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)>
May 4 '08 #8

P: 46
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
May 5 '08 #9

missinglinq
Expert 2.5K+
P: 3,532
Glad we coul help again!

Linq ;0)>
May 5 '08 #10

Post your reply

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