#1

Sel Client_ID, Server_ID +
 from yourTable +
 whe Svc_date between 4/1/2003 and 6/30/2003 and +
        Client_ID not in +
          (sel Client_ID from yourTable whe Svc_code = 122 and +
           Svc_Date between 7/1/2003 and 9/30/2003)

#2 (pretty much the same thing)

Sel Client_ID, Server_ID +
 from yourTable +
 whe Unit = 102 and +
        Svc_date between 4/1/2003 and 6/30/2003 and +
        Client_ID not in +
          (sel Client_ID from yourTable whe Svc_code = 150 and +
           Svc_Date between 7/1/2003 and 9/30/2003)


Ben Petersen

On 17 Oct 2003, at 6:34, Plateautel.net wrote:

> This is a multi-part message in MIME format.
> 
> ------=_NextPart_000_0012_01C39478.BCCFB0A0
> Content-Type: text/plain;
>  charset="iso-8859-1"
> Content-Transfer-Encoding: quoted-printable
> 
> Can anyone help?  Stupid question, huh?  Please help!
> 
> Working in a mental health facility, the clinicians are required to =
> perform quarterly reviews on clients.
> I have a table that contains=20
> 
> Client_ID     Integer
> Unit             Integer
> Svc_Code    text
> Svc_date    date
> Server_ID    Integer
> 
> A Svc_code of 122 is a quartely update
> A svc_code of 150 is an ASI
> 
> I need to find out two things
> 
> If the client had any services, regardless of the unit, in the 2nd qtr,  =
> then a svc_code of 122 must be performed in the third qtr.
> I need the client_id and Server_id for any clients that have any =
> services in the second qtr, but do not have a Svc_code of 122 in the =
> third qtr.
> 
> Also,
> If the client is assigned to unit 102 and has had any services in the =
> 2nd qtr then a svc_code of 150 must be performed in the third qtr.
> I need the client_id and Server_id for any clients that are assigned to =
> unit 102 and has services in the second qtr, but does not have a =
> Svc_code of 150 in the third qtr.
> 
> Please
> 
> =20
> 
> ------=_NextPart_000_0012_01C39478.BCCFB0A0
> Content-Type: text/html;
>  charset="iso-8859-1"
> Content-Transfer-Encoding: quoted-printable
> 
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
> <HTML><HEAD>
> <META http-equiv=3DContent-Type content=3D"text/html; =
> charset=3Diso-8859-1">
> <META content=3D"MSHTML 6.00.2733.1800" name=3DGENERATOR>
> <STYLE></STYLE>
> </HEAD>
> <BODY bgColor=3D#ffffff>
> <DIV><FONT face=3DTechnical>Can anyone help?&nbsp; Stupid question, =
> huh?&nbsp;=20
> Please help!</FONT></DIV>
> <DIV><FONT face=3DTechnical></FONT>&nbsp;</DIV>
> <DIV><FONT face=3DTechnical>Working in a mental health facility, the =
> clinicians=20
> are required to perform quarterly reviews on clients.</FONT></DIV>
> <DIV><FONT face=3DTechnical>I&nbsp;have a table that contains =
> </FONT></DIV>
> <DIV>&nbsp;</DIV>
> <DIV><FONT=20
> face=3DTechnical>Client_ID&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Integer</FONT></D=
> IV>
> <DIV><FONT=20
> face=3DTechnical>Unit&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
> p;&nbsp;&nbsp;&nbsp;&nbsp;Integer</FONT></DIV>
> <DIV><FONT face=3DTechnical>Svc_Code&nbsp;&nbsp;&nbsp; text</FONT></DIV>
> <DIV><FONT face=3DTechnical>Svc_date&nbsp;&nbsp;&nbsp; date</FONT></DIV>
> <DIV><FONT face=3DTechnical>Server_ID&nbsp;&nbsp;&nbsp; =
> Integer</FONT></DIV>
> <DIV><FONT face=3DTechnical></FONT>&nbsp;</DIV>
> <DIV><FONT face=3DTechnical>A Svc_code of 122 is a quartely =
> update</FONT></DIV>
> <DIV><FONT face=3DTechnical>A svc_code of 150 is an ASI</FONT></DIV>
> <DIV><FONT face=3DTechnical></FONT>&nbsp;</DIV>
> <DIV><FONT face=3DTechnical>I need to find out two things</FONT></DIV>
> <DIV><FONT face=3DTechnical></FONT>&nbsp;</DIV>
> <DIV><FONT face=3DTechnical>If the&nbsp;client had any services, =
> regardless of the=20
> unit,&nbsp;in the 2nd qtr, &nbsp;then a svc_code of 122 must be =
> performed in the=20
> third qtr.</FONT></DIV>
> <DIV><FONT face=3DTechnical>I need the client_id and Server_id for any =
> clients=20
> that have any services in the second qtr, but do not have a Svc_code of =
> 122 in=20
> the third qtr.</FONT></DIV>
> <DIV><FONT face=3DTechnical></FONT>&nbsp;</DIV>
> <DIV><FONT face=3DTechnical>Also,</FONT></DIV>
> <DIV><FONT face=3DTechnical>If the client is assigned to unit 102 and =
> has&nbsp;had=20
> any services in the 2nd qtr then a svc_code of 150 must be performed in =
> the=20
> third qtr.</FONT></DIV>
> <DIV><FONT face=3DTechnical>
> <DIV><FONT face=3DTechnical>I need the client_id and Server_id for any =
> clients=20
> that&nbsp;are&nbsp;assigned to unit 102 and&nbsp;has&nbsp;services in =
> the second=20
> qtr, but does not have a Svc_code of 150 in the&nbsp;third =
> qtr.</FONT></DIV>
> <DIV>&nbsp;</DIV>
> <DIV>Please</DIV></FONT></DIV>
> <DIV><FONT face=3DTechnical></FONT>&nbsp;</DIV>
> <DIV>&nbsp;</DIV></BODY></HTML>
> 
> ------=_NextPart_000_0012_01C39478.BCCFB0A0--
> 

Reply via email to