Run query based on condition-from a Newbie

Coop

New Member
Joined
Aug 19, 2003
Messages
33
I have a macro which exports data from Excel to Access. Some of the fields are weekday(Monday, Tuesday, etc.), business day (1,2,3,etc) ,calendar day (1,2,3,etc.), and various amounts in other fields. In Access, I have built 3 queries which use the weekday, business day or calendar day as criteria. Is it possible to change the criteria based on current day of the week without changing the criteria (day) manually? I was thinking that the Access equivalent of the Excel formula, text(today(),"dddd"), goes onto the Criteria field. Can this also be done with the current day query, using calendar day,using day(today()) as well? Thank you.
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
For the Access equivalent of TEXT try format:

Format(Date(), "dddd")

The function Day will return the calendar day:

Day(Date())

And finally Weekday will return the day of the week:

Weekday(Date())

Note: Date() replaces TODAY.
 
Upvote 0

Forum statistics

Threads
1,221,827
Messages
6,162,202
Members
451,752
Latest member
freddocp

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top