Showing last collected record in gridview

Discussion in '.NET' started by DotBlonde, Oct 5, 2009.

  1. DotBlonde

    DotBlonde

    Joined:
    Oct 5, 2009
    Messages:
    1
    I have 2 SQL server tables

    1. Bloodtest containing a list for valid bloodtests (bloodtestNumber) and descriptions (BloodWorkx)
    2 PatientBloodtest containing the results captured for a specific patient (PatientBloodWorx)

    Users capture blood test results at different times and they do not always capture all the bloodtests. ALL I want to do is to display the last blood test results captured for the patient in a gridview using this query

    SELECT BloodWorx.BldTestName, PatientBloodWorx.membershipNumber,
    PatientBloodWorx.BeneficiaryCode, MAX(PatientBloodWorx.BloodTestDate) AS LastOfbloodtestdate, MAX(PatientBloodWorx.BloodTestReceiveDate) AS LastOfBLOoDTESTRECEIVEDATE, MAX(PatientBloodWorx.BloodResult)
    AS LastOfBloodresult FROM BloodWorx LEFT JOIN
    PatientBloodWorx ON BloodWorx.BldNumber = PatientBloodWorx.BloodTest
    GROUP BY BloodWorx.BldTestName, PatientBloodWorx.membershipNumber,
    PatientBloodWorx.BeneficiaryCode, BloodWorx.BldNumber
    HAVING (PatientBloodWorx.membershipNumber = @membershipNumber) AND (PatientBloodWorx.BeneficiaryCode = @BeneficiaryCode)

    Can someone help?
     
    DotBlonde, Oct 5, 2009
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?Sg==?=

    When are static members garbage collected?

    =?Utf-8?B?Sg==?=, Feb 25, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    352
    bruce barker
    Feb 25, 2004
  2. Cheng Thao
    Replies:
    0
    Views:
    399
    Cheng Thao
    Aug 6, 2003
  3. Mark McKay
    Replies:
    5
    Views:
    893
    xarax
    Oct 3, 2003
  4. =?Utf-8?B?VmxhZGlzbGF2IEtvc2V2?=

    Static class members disappearing (GC collected?!)

    =?Utf-8?B?VmxhZGlzbGF2IEtvc2V2?=, May 15, 2006, in forum: ASP .Net
    Replies:
    6
    Views:
    424
    =?Utf-8?B?VmxhZGlzbGF2IEtvc2V2?=
    May 16, 2006
  5. Scott Robinson

    Socket being garbage collected too early

    Scott Robinson, Dec 16, 2004, in forum: Python
    Replies:
    4
    Views:
    419
    Scott Robinson
    Dec 18, 2004
Loading...

Share This Page