B
Bob Griendling
My table has only three fields: Date, Price1 and Price 2
I need to know if, during the first 7 days of the month, price2 was $4 more
or less than price1 was on the first of the month.
I developed my query using the wizard and then tweaked it because I couldn't
figure out how the query could make the comparison. The query is of a query
called 1st 7 days. (I had data from all month but wanted to look at only the
1st 7 days).
My first field in the query is:
Date By Month: Format$([1st 7 days].[Date],'yyyy mm') and TOTAL is "Group
by"
2nd field:
Price1 WHERE (Day([Date])=1). It is returning the first date of the month,
only if it is 1. Given that not every month will have a date 1 (Prices are
only Mon.-Fri.), I need to figure out how to make it Date=2 if and only if
there is no Date=1, or Date=3 if and only if there is no Date=1 or 2.
3rd field is Price 1 and TOTAL is "Group by"
4th field is Price 2 WHERE (Day([Date])>=1) ... but it only returns Price2
of Day 1
5th field is Price2 TOTAL is Group by
6th field is Expr: ([Price2]-{Price1]) with criteria >=4 OR <=4
7th field (which I do not understand but was generated by the wizard) is:
Expr2: Year([1st 7 days].[Date])*12+DatePart('m',[1st 7 days].[Date])-1
Any help getting the query to compare the Price1 on Day 1 with all Price2s
on days 1-7 and how to look at dates 2 or 3 when there is no preceding date
that month would be appreciated.
(Thanks to Karl Dewey and John Spencer for getting me this far.)
Bob
I need to know if, during the first 7 days of the month, price2 was $4 more
or less than price1 was on the first of the month.
I developed my query using the wizard and then tweaked it because I couldn't
figure out how the query could make the comparison. The query is of a query
called 1st 7 days. (I had data from all month but wanted to look at only the
1st 7 days).
My first field in the query is:
Date By Month: Format$([1st 7 days].[Date],'yyyy mm') and TOTAL is "Group
by"
2nd field:
Price1 WHERE (Day([Date])=1). It is returning the first date of the month,
only if it is 1. Given that not every month will have a date 1 (Prices are
only Mon.-Fri.), I need to figure out how to make it Date=2 if and only if
there is no Date=1, or Date=3 if and only if there is no Date=1 or 2.
3rd field is Price 1 and TOTAL is "Group by"
4th field is Price 2 WHERE (Day([Date])>=1) ... but it only returns Price2
of Day 1
5th field is Price2 TOTAL is Group by
6th field is Expr: ([Price2]-{Price1]) with criteria >=4 OR <=4
7th field (which I do not understand but was generated by the wizard) is:
Expr2: Year([1st 7 days].[Date])*12+DatePart('m',[1st 7 days].[Date])-1
Any help getting the query to compare the Price1 on Day 1 with all Price2s
on days 1-7 and how to look at dates 2 or 3 when there is no preceding date
that month would be appreciated.
(Thanks to Karl Dewey and John Spencer for getting me this far.)
Bob