cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
djolly
Engaged Sweeper
Hi there,

Need help with an SQL query.

I want to enter a purchase date and warranty date for ALL computers of a particular model.

The model is DG41WV and the purchase date is 26/06/2011

Thank you in advance
2 REPLIES 2
djolly
Engaged Sweeper
Worked a treat - thanks
Hemoco
Lansweeper Alumni
Execute the queries below in your Lansweeper configuration console under Lansweeper\Database Scripts.

Purchase date
INSERT INTO tblCompCustom (Computername)
SELECT Computername
FROM tblComputers
WHERE (Computername NOT IN (SELECT Computername FROM tblCompCustom AS tblCompCustom_1))
GO
UPDATE tblCompCustom
SET PurchaseDate = '06/26/2011'
FROM tblCompCustom INNER JOIN
tblComputersystem ON tblCompCustom.Computername = tblComputersystem.Computername
WHERE (tblComputersystem.Model LIKE 'DG41WV')


Warranty date
(Replace "YourWarrantyDate".)
INSERT INTO tblCompCustom (Computername)
SELECT Computername
FROM tblComputers
WHERE (Computername NOT IN (SELECT Computername FROM tblCompCustom AS tblCompCustom_1))
GO
UPDATE tblCompCustom
SET Warrantydate = 'YourWarrantyDate'
FROM tblCompCustom INNER JOIN
tblComputersystem ON tblCompCustom.Computername = tblComputersystem.Computername
WHERE (tblComputersystem.Model LIKE 'DG41WV')