Hi SQLBill,
Thanks for the reply. You actually have a point. I will have to setup for that. We have a termination table thats linked to the Patients table (PatientId is Key). It contains two fields:
DOA (Date of Admission)
DOT (Date of Termination)
When they first add or admitt a client, the...
Hi Everyone,
>>
So, basically you want EVERYONE that was active during the specified dates. Is that correct?
<<<
I guess it comes down to that.
>>>>Question....if they don't have an ATTENDANCE.AttendDate between those dates - HOW do you know they are active during that time frame? Do you...
Thats not what I wanted. The original query did work before they asked to include Active clients that have not attended within the date range. Now, an updated version of Denis query almost works :
SELECT DISTINCT PATIENTS.PatientID, PATIENTS.LastName+', '+PATIENTS.FirstName AS P_NAME...
Hi Denis,
Thanks for the reply. I played with that query and did not get the results I expected. there is (in my data) a client that has not been in the program at all in Dec and he does not show up in the results. I though about trying to union all the original query with one that would query...
Hi Everyone,
I have a query that returns clients that have attended the program. But I now need to update the query so that it does the above, but also clients that did not attend within the date range and that are activeclients. Would you mind a few pointers in the right direction. Here is the...
Hi bborissov,
Thanks again for the reply. That worked with alittle modifications.
I have what may seem like a simple question, but I can't seem to quit get it, if its possible. Is there a way to break down a query in a If block or Case statement. For example, taking only a portion of the query...
Hi Everyone,
I'm having a issue with a query I got help here on (I also what to thank bborissov again for the help). Here is what I need. We need to create a query that returns the name, id and dates that the patients have missed (did not showed up). The result must be based on a date range and...
Hi bborissov,
I ran into one little issue, I hope you can help. If I enter the same date for both the Begin and End dates I will not get any results back even though I know there is data for that date. I have a feeling that it may have something to with this line:
where...
Hi bborissov,
I would like to thank everyone for the help. I did end up using your solution with a few slight changes (only cause I could not get the join with the declared table to work. So I added a table to hold the data. I ended up with the following:
CREATE PROCEDURE...
Hi r937,
Thanks for the reply.
>you need to cross join the patients to the dates before >doing the LEFT OUTER JOIN to the data (which i prefer to >the NOT EXISTS -- i don't why, i just do)
I didn't see any Left Outer join in the above query. Could you give an example of what you ment. Thank so...
Hi bborissov,
Thank you so much for the help. This appears to be working great. Could you please explain whats happening in the query. I see alot up sub queries but not sure why they where needed. I want to get a better understanding on the query because I have to add the Patient name (from the...
Hi maswein,
Thanks for the reply. This works great, but I was given an extra twist to this one. I need to get the dates for all the clients. I tried to modify the query like so:
declare @dt1 smalldatetime
Declare @dt2 smalldatetime
select @dt1 = '1/2/2005'
Select @dt2 = '7/20/2006'
create table...
Hi Everyone,
I was wondering how I could date the following table:
ClientId
AttendDate
This table holds dates that our client has been in our office. But I need to find out what dates the clinet was not there given a date range. What is the best way to do this? Thanks for any help.
Michael
I almost forgot something. There can be cases where the there may not be any record in the TERMINATION for the Patientid, I still need these Patients also.
Any ideas? Thanks
Michael
Hi Skip,
Thanks for the reply. The Max is a problem because it is a aggregate function. And I can't add all the field as part of the aggregate. Maybe I can create some sort of subquery to get only the Newest date.
Michael
Hi Everyone,
I have a query that needs to pull data out of 3 tables. Nothing to hard so far. Here the query:
SELECT Patients.PatientId, TERMINATION.DOA, TERMINATION.DOT, PATIENTS.PatientID, PATIENTS.LastName, PATIENTS.FirstName, PATIENTS.COUNSELOR, PATIENTS.MEDICAID_ID, PATIENTS.DOB...
Just wanted to post the markup for the gridview, to see if this helps. I've seen post mention that if the fields are not databound, there will not be any Oldvalues or newvalues generated, but as you can see, I've got most of the fields bound:
<asp:GridView ID="grdPOs" runat="server"...
Hi
I'm having a problem getting the newvalues or oldvalues from the RowUpdating
event. I have the following code for the event(See note):
Protected Sub grdPOs_RowUpdating(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles grdPOs.RowUpdating
Dim...
Hi Bob,
Thanks for the reply. I got the event to work correctly now, but based on what you've said then maybe I need to go a different way. I thought that the variable would stay active for the life of the page. So, if I understand you correctly then the var data is not saved in the page between...
Hi Everyone,
I'm working on my first ASP.NET app and have been trying to access a var located in the MasterPage. I've tried using a Property to access the var but could not get that to work, so it was suggested that I try events. So here is the standard flow I'll need:
1. User enter UserId &...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.