paulsteigel > 18-08-14, 12:01 PM
svhsph > 18-08-14, 02:04 PM
(18-08-14, 12:01 PM)paulsteigel Đã viết: Bạn có thể dùng thêm từ khóa Select Top 5 .... from.... trong câu lệnh Query dùng trong báo cáo!
Nếu RecordSource là tên một bảng thì bạn sử dụng cú pháp Select Top 5 Frequency, [các trường khác cách nhau bằng dấu phẩy,....] from [Tên bảng] order by [Frequency] DSC;
Tham khảo thêm chỗ này để có thêm ví dụ minh họa nhé
http://www.techonthenet.com/access/queri...ts2007.php
Hoặc đây nữa!
http://www.techonthenet.com/access/queri...esults.php
https://www.mediafire.com/?mtbsba925qy0ytb
paulsteigel > 18-08-14, 02:40 PM
SELECT TOP 5 [Top 10].diagnosis AS [Injury code], ICD10_1.description AS [Name of injury], ICD10.description,
diagnosis.diagnosis AS Reason, ICD10.description, Count(diagnosis.diagnosis) AS CountOfdiagnosis1
FROM ((([Top 10] INNER JOIN 8044 ON [Top 10].diagnosis = [8044].diagnosis) INNER JOIN diagnosis ON [8044].admission_id =
diagnosis.admission_id) INNER JOIN ICD10 ON diagnosis.diagnosis = ICD10.code) INNER JOIN ICD10 AS ICD10_1
ON [Top 10].diagnosis = ICD10_1.code
GROUP BY [Top 10].diagnosis, ICD10_1.description, diagnosis.diagnosis, ICD10.description, ICD10.description, diagnosis.position,
diagnosis.Other
HAVING (((diagnosis.diagnosis) Like "Y*" Or (diagnosis.diagnosis) Like "X*" Or (diagnosis.diagnosis) Like "W*") AND
((diagnosis.position)=2) AND ((diagnosis.Other) Like "P"))
ORDER BY [Top 10].diagnosis, Count(diagnosis.diagnosis) DESC;
svhsph > 18-08-14, 03:37 PM