Correct placement of AND.....

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I decided to keep two separate queries in the process. Apparently simpler
than combining. Here they are:

This first one is C239BigAggregates.....

SELECT Avg([C239.Mean]) AS C239AvgMean,
Avg([C239.Median]) AS C239AvgMedian,
Avg([C239.N]) AS C239AvgN,
Avg([C239.Q1]) AS C239AvgQ1,
Avg([C239.Q3]) AS C239AvgQ3,
Avg([C239.Skewness]) AS C239AvgSkewness,
StDev([C239.Mean]) AS C239StDevMean,
StDev([C239.Median]) AS C239StDevMedian,
StDev([C239.N]) AS C239StDevN,
StDev([C239.Q1]) AS C239StDevQ1,
StDev([C239.Q3]) AS C239StDevQ3,
StDev([C239.Skewness]) AS C239StDevSkewness
FROM C239;


This second one is C239BigStandardized.....

SELECT C239.*,
[C239.Mean]-[C239BigAggregates.C239AvgMean]/[C239BigAggregates.C239StDevMean]
AS C239ZMean
FROM C239, C239BigAggregates
WHERE
((([C239.Mean]-[C239BigAggregates.C239AvgMean]/[C239BigAggregates.C239StDevMean])>=2));


Appears to work just fine.

As you might see, the second one, so far, only deals with Mean. Well, I
want to do the same thing with the other fields -- I want to only see those
rows (in combination with all fields) that exceed their Z-score of 2.

So, I need to put an AND in the second query. Could I put the whole thing
in parenthesis, and do a second just like the first, except "Median"
replacing the "Mean" parts, etc?

I'll attempt, while awaiting some advice here.

Thanks,
Nicholas
 
Side Question:

In the second query, is it really necessary to include the AS part, the
alias -- we don't appear to use it subsequently, but, instead, write out the
whold equation once again.

Thanks.
 
Phew.... rounding third base.

Enough on this thread -- I figured this one out.

But will have a final question tomorrow.....

Thanks,
Nicholas
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Can't use the alias??? 3

Back
Top