index | search | no replies | posting guidelines | help | login | register |
Index » Products » ASP Report Wizard v2 |
| |||||||
Sep 17 2005, 7:52 PM |
| ||||||
lirving@coffs.com.au since: Feb 22, 2005 from: somewhere | Here is some working SQL from my DB, you can see the repeated trip to the revalues table using Alias names fro the table and field. Can I do this in report Wizard SELECT sex.Value_Name AS refvalues_Value_Name, disabilitytype.Value_Name AS disabilitytype_Value_Name, Referral.Next_Contact_type AS Referral_Next_Contact_type, NextContactType.Value_Name AS NextContactType_Value_Name, ReferralOrigin.Value_Name AS ReferralOrigin_Value_Name, CurrentAccPlacement.Value_Name AS CurrentAccPlacement_Value_Name, Referral_Received_Date, Name, Address, Town, Postcode, Date_of_Birth, NESB, Language_Spoken, ATSI, Referral_Other, [Primary_Carer_ATSI/NESB], AGE_of_Primary_Carer, Primary_Carer_Heath_Issues, Primary_Carer_Heath_Issues_Description, Referral.Next_Contact AS Referral_Next_Contact, Exit_Date FROM Plans INNER JOIN ((((((Referral INNER JOIN refvalues sex ON Referral.Sex = sex.Value_ID) INNER JOIN refvalues disabilitytype ON Referral.Disability_Type = disabilitytype.Value_ID) INNER JOIN refvalues NextContactType ON Referral.Next_Contact_type = NextContactType.Value_ID) INNER JOIN refvalues ReferralOrigin ON Referral.Referral_Origin = ReferralOrigin.Value_ID) INNER JOIN refvalues CurrentAccPlacement ON Referral.Current_Accomodation_Placement = CurrentAccPlacement.Value_ID) INNER JOIN refvalues Criticalissues ON Referral.Critical_Issues = Criticalissues.Value_ID) ON Plans.Ref_ID = Referral.Ref_ID WHERE Referral.Postcode LIKE '%{s_Postcode}%' AND Referral.Date_of_Birth >= #{s_Date_of_Birth}# AND Referral.NESB = {s_NESB} AND Referral.Referral_Received_Date >= #{s_Referral_Received_Date}# AND Referral.Language_Spoken LIKE '%{s_Language_Spoken}%' AND Referral.ATSI = {s_ATSI} AND [Primary_Carer_ATSI/NESB] = {s_Primary_Carer_ATSI_NESB} AND Referral.AGE_of_Primary_Carer >= {s_AGE_of_Primary_Carer} AND Referral.Next_Contact >= #{s_Next_Contact}# AND Referral.Next_Contact_type = {s_Next_Contact_type} AND ReferralOrigin.Value_Name LIKE '%{s_ReferralOrigin_Value_Name}%' AND Plans.Exit_Date >= #{Exit_Date}# ORDER BY Referral.Name desc | ||||||
Pages: (1) [1] |