USE [HelpDesk02_Def]
GO

/***  When Condition for Auto-Close Tickets   ***/
	
IF NOT EXISTS( SELECT * FROM [dbo].[tblSystemConditions] WHERE nID=28 AND [nRow]=1  )
INSERT [dbo].[tblSystemConditions] ([nID], [tTotal], [tName],  [tTest], [tValue],
    [tAndOr], [nLevel], [nParent], [nChild], [nBrother],
    [nRow], [fWhenCondition], [nDtsFieldID])
	VALUES ( 28, NULL, 'Update Date', '<', '<Days Ago:90>', 
	'And', NULL, NULL, NULL, 2, 
	1, -1, 9);

IF NOT EXISTS( SELECT * FROM [dbo].[tblSystemConditions] WHERE nID=28 AND [nRow]=2  )
INSERT [dbo].[tblSystemConditions] ([nID], [tTotal], [tName],  [tTest], [tValue],
    [tAndOr], [nLevel], [nParent], [nChild], [nBrother],
    [nRow], [fWhenCondition], [nDtsFieldID])
	VALUES ( 28, NULL, 'Progress', '=', 'To Be Verified', 
	NULL, NULL, NULL, NULL, 1, 
	2, -1, 21);
	
GO

