cgxavier Posted January 22, 2008 Share Posted January 22, 2008 I have here a formula that will give me one individual record at a time, that is the max for that record or the latest one. I have trouble figuring how to get all max records, that is beign able to see all the records at one time.Thank you for the helpSELECT [sn].[WrkstaId] ,[sn].[Computer Model] ,[sn].[serial Number] ,[sn].[Asset Tag] ,[sn].[Computer Type] ,[id].[Name] ,[id].[Domain] ,[id].[OS Name] ,[id].[OS Type] ,[id].[Last Logon User] ,[id].[Last Logon Domain] ,[id].[Client Date] FROM [Altiris].[dbo].[AeXInv_AeX_HW_Serial_Number] sn INNER JOIN [Altiris].[dbo].[AeXInv_AeX_AC_Identification] id ON [sn].[WrkstaId]=[id].[WrkstaId] WHERE [sn].[WrkstaId]=(SELECT MAX([WrkstaId]) FROM [Altiris].[dbo].[AeXInv_AeX_HW_Serial_Number] WHERE [serial Number]= '81MSLD1') ORDER BY [sn].[_id] DESC Link to comment Share on other sites More sharing options...
Synook Posted January 24, 2008 Share Posted January 24, 2008 If you get rid of the WHERE clause all records will be displayed Link to comment Share on other sites More sharing options...
cgxavier Posted January 24, 2008 Author Share Posted January 24, 2008 If you get rid of the WHERE clause all records will be displayedThank you for the help i found out later last night. Link to comment Share on other sites More sharing options...
cgxavier Posted January 24, 2008 Author Share Posted January 24, 2008 If you get rid of the WHERE clause all records will be displayedi knowt now with your help that by removing WHERE Clause it will display all the records. Tha's good. ButIm using this query: WHERE [sn].[WrkstaId]=(SELECT MAX([WrkstaId]) FROM [Altiris].[dbo].[AeXInv_AeX_HW_Serial_Number] WHERE [serial Number]= '81MSLD1')This will give me individual records and it will give the MAX or the most recent of what ever record i call for individually, but i need to see all records without Duplicates, I know that i can use DISTINCT but im now sure how or if there's some other way to manipulate the data so i can get # of records rathere than # + records.I hope that you understand Thank you Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.