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

Day part of Date

P: n/a
I have 2 fields: Date Field and Amount Field. How do I get the day
part of a Date field like Sunday, 21 November to fill the Amount Field
automatically in which the days of the week have different amounts.
Example Sunday = 55, Monday = 110, Tuesday = 120 etc

if DatePart is Sunday then AmountField = 55
if DatePart is Monday then AmountField = 110
Thank you
Nov 13 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
You could use a calculated textbox or code. The equation would be similar to
this:

=Choose(DatePart("w", [DateField]), 55, 110, 120, 130, 150, 160, 170)

The DatePart expression will return the values 1 through 7. Choose will then
pick the value that corresponds with that number. The first value for 1, the
second for 2, etc.

--
Wayne Morgan
MS Access MVP
"Shannon" <ta*****@hotmail.com> wrote in message
news:9a*************************@posting.google.co m...
I have 2 fields: Date Field and Amount Field. How do I get the day
part of a Date field like Sunday, 21 November to fill the Amount Field
automatically in which the days of the week have different amounts.
Example Sunday = 55, Monday = 110, Tuesday = 120 etc

if DatePart is Sunday then AmountField = 55
if DatePart is Monday then AmountField = 110
Thank you

Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.