• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1049
  • Last Modified:

Percentiles in MS Access cont.

This is a continuation of a previous question "Percentile Calculations in MS Access"  that was already answered by harfang...


The SQL you given for expanding the criteria did not work for me, so i modified the syntax a bit (in regards to the AND statement)....

SELECT Percentile(0.25,"temp","water","time=" & water.time and "DOY=" & water.DOY) AS P25, water.time, water.DOY
FROM water
GROUP BY water.time, water.DOY;

However, I still can't get it to run. I tried a few other changes, and still no go.

Do you see anything wrong with the syntax I have here?

dougf1r
0
dougf1r
Asked:
dougf1r
  • 3
  • 2
1 Solution
 
Patrick MatthewsCommented:
SELECT Percentile(0.25,"temp","water","time=#" & water.time & "# and DOY=" & water.DOY) AS P25, water.time
FROM water
GROUP BY water.time, water.flow_DOY;


unless DOY is a datetime field too, in which case:

SELECT Percentile(0.25,"temp","water","time=#" & water.time & "# and DOY=#" & water.DOY & "#") AS P25, water.time
FROM water
GROUP BY water.time, water.flow_DOY;

0
 
Patrick MatthewsCommented:
dougf1r,

BTW, in cases like this it is wise to post a link to the previous question.

Regards,

Patrick
0
 
dougf1rAuthor Commented:
Patrick,

I tried this and it gives an error. Both of the group by fields are number.

Link to previous question at:

http://www.experts-exchange.com/Programming/Languages/SQL_Syntax/Q_22723540.html?cid=239#a19594858

dougf1r
0
 
dougf1rAuthor Commented:
Replacing your syntax for date as numeric it is working.

Thanks for the info Patrick,

- dougf1r
0
 
Patrick MatthewsCommented:
dougf1r,

Glad to help :)

Regards,

Patrick
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now