Query 90 expiration

D

dar

I would like to run a qry that will show me when my insurance policyies
expire. Some expire in 30 days others in 90.

Table: Customers
Fields:
CustomerName
ContactName
PolicyNumber
PolicyExpirationDate
 
J

John W. Vinson

I would like to run a qry that will show me when my insurance policyies
expire. Some expire in 30 days others in 90.

Table: Customers
Fields:
CustomerName
ContactName
PolicyNumber
PolicyExpirationDate

30 or 90 days from when? How (based on the information in the table) can you
tell which policy is 30 and which is 90? More information please!
 
D

Dorian

SELECT * FROM Customers where PolicyExpirationDate >= Date() ORDER BY
PolicyExpirationDate
This will list the future expiration dates but ignore those that have
already passed.
Assumes 'PolicyExpirationDate' is a date/time column.
-- Dorian
"Give someone a fish and they eat for a day; teach someone to fish and they
eat for a lifetime".
 
D

dar

The PolicyExpirationDate will have a date of when the Policy will expire.
The policy may expire in August or November. i want to run a qry that will
show me up coming policies that will expire at any given time.
 
J

John W. Vinson

The PolicyExpirationDate will have a date of when the Policy will expire.
The policy may expire in August or November. i want to run a qry that will
show me up coming policies that will expire at any given time.

Then create a query with an appropriate criterion on the PolicyExpirationDate.
For instance, if you want to find which policies expire between today and a
week from today, use a criterion
 
D

dar

Hello Dorian-
Is there any spaces? When I run it, it pops up a warning that I have a
syntas error
 
D

dar

John am I doing something wrong?

I entered test data in the field of PolicyExpirationDate with the below
criterion, it returns a query with everything I entered. I entered random
dates that were less than 7 days and more than 7 days.
 
J

John W. Vinson

John am I doing something wrong?

I entered test data in the field of PolicyExpirationDate with the below
criterion, it returns a query with everything I entered. I entered random
dates that were less than 7 days and more than 7 days.

Please open the query in SQL view and post the entire SQL string here.

Is PolicyExpirationDate in fact a Date/Time field, or is it perhaps Text
(which looks like a date but won't search chronologically)?
 
D

dar

PolicyExpirationDate is set to Date/Time

SELECT tblCustomer2.CustomerName, tblCustomer2.ContactName,
tblCustomer2.ContactNumber, tblCustomer2.PolicyNumber, tblCustomer2.Carrier,
tblCustomer2.Premium, tblCustomer2.PolicyExpirationDate,
tblCustomer2.PolicyType
FROM tblCustomer2
WHERE (((tblCustomer2.PolicyExpirationDate)>=Date() And
(tblCustomer2.PolicyExpirationDate)<=Date()+7));



..
 
J

John W. Vinson

PolicyExpirationDate is set to Date/Time

SELECT tblCustomer2.CustomerName, tblCustomer2.ContactName,
tblCustomer2.ContactNumber, tblCustomer2.PolicyNumber, tblCustomer2.Carrier,
tblCustomer2.Premium, tblCustomer2.PolicyExpirationDate,
tblCustomer2.PolicyType
FROM tblCustomer2
WHERE (((tblCustomer2.PolicyExpirationDate)>=Date() And
(tblCustomer2.PolicyExpirationDate)<=Date()+7));

If you run that query today that should find only records with
PolicyExpirationDate in the range from #4/27/2010# to #5/4/2010#.

If it doesn't please post a few rows of your data indicating the dates that
violate these conditions. That's wierd.
 
D

dar

Thank you John it worked! I must have typed something wrong the first time.
i went back a couple of times and found it. I had to many spaces.

Thanks again
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top