A perameter dependant on another

lovemuscle2005

Board Regular
Joined
Dec 28, 2004
Messages
99
Hi all,

I have 3 queries all the same but for different months, i.e. a different date perameter. I want to make query1 and query2 dependant on the date in query3, i.e. if Q3 is 1/1/05, Q2 would be 1/2/05 and Q1 would be 1/3/05.

I'm using at the moment the following hardcoded perameter:

WHERE ((([Performance Figures & Store].Date)=#1/1/2005#) AND (([Customer Excellence & Store].Date)=#1/1/2005#) AND (([Store manager List & Salary Template].Date)=#1/1/2005#) AND (([ASD Rate Template & Store Lookup].Date)=#2/1/2005#));

Any ideas?

Thanks in advance

:unsure:
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Hi LM2005

In query 2 design view, add query 3, under the existing date field in Q2 enter the following criteria :
=DateAdd("m", 1, [query3.Date])
- assuming the query is called 'query3' and the date field in Q3 is called 'Date'.

Repeat for Q1 but change the criteria to =DateAdd("m", 2, [query3.Date])

Rather than hard code the dates, in query 3 you could use something like this :
[Enter the date (format mm/dd/yy)]
and then use the dateadd calculation on any dates that differ (e.g. the last bit : [ASD Rate Template & Store Lookup].Date)=#2/1/2005#)

HTH, Andrew. :)
 
Upvote 0

Forum statistics

Threads
1,221,877
Messages
6,162,579
Members
451,776
Latest member
bosvinn

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