Brenda-
Maybe something like:
SELECT MedicalIDNo, Min(StartDt) As FirstDate, Max(EndDt) As LastDate,
Max(EndDt) = Min(StartDt) As NoDays
FROM MyTable
GROUP BY MedicalIDNo
John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications
SQL Queries for Mere Mortals
http://www.viescas.com/
(Paris, France)
-----Original Message-----
From: MS_Access_Professionals@yahoogroups.com
[mailto:MS_Access_Professionals@yahoogroups.com] On Behalf Of haydenbl
Sent: Wednesday, August 07, 2013 6:19 PM
To: MS_Access_Professionals@yahoogroups.com
Subject: [MS_AccessPros] Query about DateDiff
Hello All,
I am working with Access 2010. I have a medical claim table. Within that
table I have the following fields:
MedicalIDNo (Int)
ClaimNo (Int)
StartDt (Date)
EndDt (Date)
Within this table I can have multiple claims. I am trying to calculate the
total number of days for each individual MedicalIDNo between the first
StartDt and and the last EndDt. I know how to group them together, but I am
not sure how to come up with one row per MedicalIDNo with the oldest date
and the most current date.
Thanks in advance for your help.
------------------------------------
Yahoo! Groups Links
| Reply via web post | Reply to sender | Reply to group | Start a New Topic | Messages in this topic (2) |
Tidak ada komentar:
Posting Komentar