A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Query 90 expiration



 
 
Thread Tools Display Modes
  #1  
Old April 26th, 2010, 04:37 PM posted to microsoft.public.access.queries
Dar
external usenet poster
 
Posts: 86
Default Query 90 expiration

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
  #2  
Old April 26th, 2010, 05:40 PM posted to microsoft.public.access.queries
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Query 90 expiration

On Mon, 26 Apr 2010 08:37:01 -0700, dar wrote:

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!
--

John W. Vinson [MVP]
  #3  
Old April 26th, 2010, 05:41 PM posted to microsoft.public.access.queries
Dorian
external usenet poster
 
Posts: 542
Default Query 90 expiration

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".


"dar" wrote:

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

  #4  
Old April 26th, 2010, 06:36 PM posted to microsoft.public.access.queries
Dar
external usenet poster
 
Posts: 86
Default Query 90 expiration

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.

"John W. Vinson" wrote:

On Mon, 26 Apr 2010 08:37:01 -0700, dar wrote:

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!
--

John W. Vinson [MVP]
.

  #5  
Old April 26th, 2010, 08:43 PM posted to microsoft.public.access.queries
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Query 90 expiration

On Mon, 26 Apr 2010 10:36:01 -0700, dar wrote:

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

= Date() AND = Date() + 7


--

John W. Vinson [MVP]
  #6  
Old April 26th, 2010, 09:03 PM posted to microsoft.public.access.queries
Dar
external usenet poster
 
Posts: 86
Default Query 90 expiration

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

"Dorian" wrote:

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".


"dar" wrote:

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

  #7  
Old April 27th, 2010, 04:08 PM posted to microsoft.public.access.queries
Dar
external usenet poster
 
Posts: 86
Default Query 90 expiration

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.

"John W. Vinson" wrote:

On Mon, 26 Apr 2010 10:36:01 -0700, dar wrote:

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

= Date() AND = Date() + 7


--

John W. Vinson [MVP]
.

  #8  
Old April 27th, 2010, 05:45 PM posted to microsoft.public.access.queries
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Query 90 expiration

On Tue, 27 Apr 2010 08:08:01 -0700, dar wrote:

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)?
--

John W. Vinson [MVP]
  #9  
Old April 27th, 2010, 06:30 PM posted to microsoft.public.access.queries
Dar
external usenet poster
 
Posts: 86
Default Query 90 expiration

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));



..

"John W. Vinson" wrote:

On Tue, 27 Apr 2010 08:08:01 -0700, dar wrote:

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)?
--

John W. Vinson [MVP]
.

  #10  
Old April 27th, 2010, 08:01 PM posted to microsoft.public.access.queries
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Query 90 expiration

On Tue, 27 Apr 2010 10:30:02 -0700, dar wrote:

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.
--

John W. Vinson [MVP]
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:50 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.