Jump to content

cgxavier

Members
  • Content Count

    6
  • Joined

  • Last visited

Community Reputation

0 Neutral

About cgxavier

  • Rank
    Newbie
  1. cgxavier

    DISTINCT

    Sorry for the confusion. There's multiple unique wrkstaId but same Serial Number can appear several times, with higher WrkstaId value at later dates. What i need is to have the Highest/Latest WrkstaId for each unique Serial Number. CODEWrkstaId Computer Model Serial Number Asset Tag Computer Type1 A B C D2 W B Y Z3 F A G H
  2. cgxavier

    DISTINCT

    I have never used DISTINCT before so help will be apreciated. Im trying to get all the SERIAL NUMBERS, but i know theres duplicates, i dont need the duplicates. So what Im trying to say is that i want to sort them using the SERIALNUMBERS but i dont want duplicates from the SERIAL NUMBERS.THANK YOUSELECT DISTINCT [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].[serial Number]=DISTINCT FROM [Altiris].[dbo].[AeXInv_AeX_HW_Serial_Number]
  3. cgxavier

    Not all records

    i 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
  4. cgxavier

    Not all records

    Thank you for the help i found out later last night.
  5. cgxavier

    Not all records

    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
×
×
  • Create New...