2 Replies - 719 Views - Last Post: 17 September 2015 - 02:39 PM

#1 ricososwavay   User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 113
  • Joined: 11-February 14

Get Count of field and display if more than one

Posted 17 September 2015 - 08:54 AM

I am new to access coming from sql server. I want to find the range of all codes between 10020 and 70000 and if more than one of these codes shows for the same day for the same social show these. I have gotten everything to work except for only showing the ones with the same date that have more than one code applied for the same date.

Here is my query so far:

SELECT Claims.*
FROM Claims
WHERE (((Claims.PT_SSN)="400868229") AND ((Claims.FROM_DATE) In (SELECT [FROM_DATE]
FROM [Claims] as Tmp GROUP BY [FROM_DATE],[PT_SSN] HAVING Count([FROM_DATE])>1) And [PT_SSN] = [Claims].[PT_SSN] )) AND ((Claims.PROC_CODE) Like "?????" And (Claims.PROC_CODE) Between "10020" And "70000" AND ((Claims.CHARGE_AMT)<>[INEL_AMT_1])) 


Is This A Good Question/Topic? 0
  • +

Replies To: Get Count of field and display if more than one

#2 ricososwavay   User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 113
  • Joined: 11-February 14

Re: Get Count of field and display if more than one

Posted 17 September 2015 - 11:41 AM

I am able to get the count I just cant display each one for some reason here is a query I used to get the count

SELECT Claims.FROM_DATE, Claims.PT_SSN
FROM Claims
WHERE (((Claims.CHARGE_AMT)<>[INEL_AMT_1]) AND ((Claims.PROC_CODE) Like "?????" And (Claims.PROC_CODE) Between "10020" And "70000"))
AND PT_SSN="400868229"
GROUP BY Claims.FROM_DATE, Claims.PT_SSN
HAVING (((Count(Claims.[FROM_DATE]))>1));

Was This Post Helpful? 0
  • +
  • -

#3 ricososwavay   User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 113
  • Joined: 11-February 14

Re: Get Count of field and display if more than one

Posted 17 September 2015 - 02:39 PM

I solved the problem I needed to use an inner join with select statement then include the where statement inside inner join and outside inner join
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1