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  

not display date in past



 
 
Thread Tools Display Modes
  #1  
Old May 9th, 2008, 11:24 PM posted to microsoft.public.access.queries
H0MELY
external usenet poster
 
Posts: 58
Default not display date in past

Thank you for looking at my question.

I have a table that is full of information about phones and their
locations...we can call it a service file. The service file will contain
information such as the PhoneID, location, model, start of service, warranty
expiration, serial number, etc...

The thing to know is that anytime a phone is replaced, a new service file is
created....that means that the table could contain multiple records with the
same PhoneID. I can use a max query to determine which date is the most
recent...but here is the issue.

I have been asked to prepare a list of all of our phone assets and to
include the warranty expiration date...only if it occurs in the future. If
the warranty is expired they want that field to be empty because the phone
has no warranty. This is easy enough to do manually...but unfortunately it
needs to be in a query that is part of a reporting tool. SO, any ideas on
how I could make this happen as part of a query.

Thank you in advance for anyone who looks at this question. Any and all
suggestions are greatly appreciated.

-John
  #2  
Old May 9th, 2008, 11:43 PM posted to microsoft.public.access.queries
Jeff Boyce
external usenet poster
 
Posts: 8,621
Default not display date in past

John

It sounds like you want to see records with a [Expiration] Date() (today's
date). You could use this as a selection criterion in a query.

Regards

Jeff Boyce
Microsoft Office/Access MVP

"H0MELY" wrote in message
...
Thank you for looking at my question.

I have a table that is full of information about phones and their
locations...we can call it a service file. The service file will contain
information such as the PhoneID, location, model, start of service,
warranty
expiration, serial number, etc...

The thing to know is that anytime a phone is replaced, a new service file
is
created....that means that the table could contain multiple records with
the
same PhoneID. I can use a max query to determine which date is the most
recent...but here is the issue.

I have been asked to prepare a list of all of our phone assets and to
include the warranty expiration date...only if it occurs in the future.
If
the warranty is expired they want that field to be empty because the phone
has no warranty. This is easy enough to do manually...but unfortunately
it
needs to be in a query that is part of a reporting tool. SO, any ideas on
how I could make this happen as part of a query.

Thank you in advance for anyone who looks at this question. Any and all
suggestions are greatly appreciated.

-John



  #3  
Old May 10th, 2008, 12:20 AM posted to microsoft.public.access.queries
John Spencer
external usenet poster
 
Posts: 2,364
Default not display date in past

Try using a calculated field.

Field: Warranty: IIF([WarrantyDate]Date(),[WarrantyDate],Null)

In a query that will show the value of the field if the field is after
the current date, otherwise it will show null(blank).

'================================================= ===
John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
'================================================= ===


H0MELY wrote:
Thank you for looking at my question.

I have a table that is full of information about phones and their
locations...we can call it a service file. The service file will contain
information such as the PhoneID, location, model, start of service, warranty
expiration, serial number, etc...

The thing to know is that anytime a phone is replaced, a new service file is
created....that means that the table could contain multiple records with the
same PhoneID. I can use a max query to determine which date is the most
recent...but here is the issue.

I have been asked to prepare a list of all of our phone assets and to
include the warranty expiration date...only if it occurs in the future. If
the warranty is expired they want that field to be empty because the phone
has no warranty. This is easy enough to do manually...but unfortunately it
needs to be in a query that is part of a reporting tool. SO, any ideas on
how I could make this happen as part of a query.

Thank you in advance for anyone who looks at this question. Any and all
suggestions are greatly appreciated.

-John

 




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 10:04 PM.


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