I am trying to pull contacts based on a radius of zipcodes.
I can do this my manually putting the ZipCodes in the Queries fine.
select Company,FirstName,LastName,Phone,ZipCode
From dbo.t_contacts
Where Church = '1'and
ZipCode in ('13760','13761','13762','13763','13850','13851','13790','13737','13732')
But I want to keep this Cities and Zipcode Radius in another table and pull in from a sub query.
Something like this.
select Company,FirstName,LastName,Phone,ZipCode
From dbo.t_contacts
Where Church = '1'and
ZipCode in (Select NY_Endicott from t_radius)"
I have two tables:
Table 1 t_contacts
Table 2 t_radius
I have t_radius with one column now called NY_Endicott and
t_radius has a column called NY_Endicott and it is populated with
id NY_Endicott
1 -Zipcodes as below-
('13760','13761','13762','13763','13850','13851','13790','13737','13732')
I can do this my manually putting the ZipCodes in the Queries fine.
select Company,FirstName,LastName,Phone,ZipCode
From dbo.t_contacts
Where Church = '1'and
ZipCode in ('13760','13761','13762','13763','13850','13851','13790','13737','13732')
But I want to keep this Cities and Zipcode Radius in another table and pull in from a sub query.
Something like this.
select Company,FirstName,LastName,Phone,ZipCode
From dbo.t_contacts
Where Church = '1'and
ZipCode in (Select NY_Endicott from t_radius)"
I have two tables:
Table 1 t_contacts
Table 2 t_radius
I have t_radius with one column now called NY_Endicott and
t_radius has a column called NY_Endicott and it is populated with
id NY_Endicott
1 -Zipcodes as below-
('13760','13761','13762','13763','13850','13851','13790','13737','13732')