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

Date question

P: n/a
OK...I hope I explain this clearly:

I have a report to run everyday for the previous day's work. In the
main table, I have the date auto populate with =date()-1 that
will give me the previous day's date. How can I tell it to subtract 3
days if today's date is a Monday?

I was e-mailed this formula, but I can not get it to work:

=Date() - IIf(Weekday(Date) = 2, 3, 1)

Any help will be greatly appreciated.
Nov 13 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On 16 Sep 2004 07:57:57 -0700, Gale wrote:
OK...I hope I explain this clearly:

I have a report to run everyday for the previous day's work. In the
main table, I have the date auto populate with =date()-1 that
will give me the previous day's date. How can I tell it to subtract 3
days if today's date is a Monday?

I was e-mailed this formula, but I can not get it to work:

=Date() - IIf(Weekday(Date) = 2, 3, 1)

Any help will be greatly appreciated.
I don't understand what you mean by In the main table, I have the date auto populate with =date()-1 <


You table should contain the date the work was done.

Your query SQL Where clause to filter out the day wanted in the report
should read like this:

Where TableName.[DateField] = Date() - IIf(WeekDay(Date())=2,3,1)

A report being run on Monday will return Friday's data.
A Report run any other day will report on the preceding day's data.

--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
Nov 13 '05 #2

P: n/a
gp******@grand-affairs.com (Gale) wrote in message news:<7e**************************@posting.google. com>...
OK...I hope I explain this clearly:

I have a report to run everyday for the previous day's work. In the
main table, I have the date auto populate with =date()-1 that
will give me the previous day's date. How can I tell it to subtract 3
days if today's date is a Monday?

I was e-mailed this formula, but I can not get it to work:

=Date() - IIf(Weekday(Date) = 2, 3, 1)

Any help will be greatly appreciated.


How about:

GetFriday: IIf(Weekday([mydate])=2,DateAdd("d",-3,[mydate]))
Nov 13 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.