3
Answers

Return Specific Value from a table

Jes Sie

Jes Sie

1y
482
1

Hello DBA's. I have a query that selects all the insured policies from the previous year, as shown below:

select	MotorCINo, 
		IssuanceType, 
		VehicleType, 
		VehiclePower, 
		VehicleChasisNo, 
		InsuranceType, 
		InsuranceOption, 
		PeriodFrom, 
		PeriodTo 
from tblMotorInsurance_eCI 
where YEAR(PeriodFrom) = YEAR(DATEADD(year,-1,GETDATE())) and PeriodTo < CAST(getdate() as date) and IssuanceType <> 'Short Term'
order by PeriodFrom desc

 

The output is also shown below:

How do I get the list of motor vehicles that did not renew the policy this year? Thank you in advance.

Answers (3)