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  

Question



 
 
Thread Tools Display Modes
  #1  
Old June 29th, 2005, 05:01 PM
JimS
external usenet poster
 
Posts: n/a
Default Question

I am trying to apply a label field to a query record based upon where it
falls in a second lookup table. The look up table has a start date and an
end date and a description (Tiger, Dog, Monkey etc)
The lookup is using a birthdate from an record of a person.
This is an example:
If John Smith birthdate falls between 4/1/1990 and 3/31/1991 then is a
"Tiger"
If John Smith birthdate falls between 4/1/1991 and 3/31/1992 then is a "Dog"
If John Smith birthdate falls between 4/1/1992 and 3/31/1993 then is a
"Monkey"

I would like to do this in a query. This would allow me to have it be
dynamic in a report. I guess I could add a field to assign in the personal
table but the query would be the preferred way.

Thanks
Tim


  #2  
Old June 29th, 2005, 06:29 PM
KARL DEWEY
external usenet poster
 
Posts: n/a
Default

Put the following in your design view of query FIELD.

Animal: Iif([BirthDateField] between [LookUpStartDate] and [LookUpEndDate],
[LookUpAnimal], "Unknown")

"JimS" wrote:

I am trying to apply a label field to a query record based upon where it
falls in a second lookup table. The look up table has a start date and an
end date and a description (Tiger, Dog, Monkey etc)
The lookup is using a birthdate from an record of a person.
This is an example:
If John Smith birthdate falls between 4/1/1990 and 3/31/1991 then is a
"Tiger"
If John Smith birthdate falls between 4/1/1991 and 3/31/1992 then is a "Dog"
If John Smith birthdate falls between 4/1/1992 and 3/31/1993 then is a
"Monkey"

I would like to do this in a query. This would allow me to have it be
dynamic in a report. I guess I could add a field to assign in the personal
table but the query would be the preferred way.

Thanks
Tim



  #3  
Old September 16th, 2005, 09:14 PM
Lori
external usenet poster
 
Posts: n/a
Default

Karl this looks like what I need to do. I have a table with commission
earned. Based on how much commission there is a rate I pay the brokers.
When I use unique values I get two lines (one for the default and the other
with the correct rate).

What am I doing wrong. Here is my formula

NewRate: IIf(Abs([commission]) Between [BreakPoints]![LowLevel] And
[BreakPoints]![HighLevel],[rate],99)

"KARL DEWEY" wrote:

Put the following in your design view of query FIELD.

Animal: Iif([BirthDateField] between [LookUpStartDate] and [LookUpEndDate],
[LookUpAnimal], "Unknown")

"JimS" wrote:

I am trying to apply a label field to a query record based upon where it
falls in a second lookup table. The look up table has a start date and an
end date and a description (Tiger, Dog, Monkey etc)
The lookup is using a birthdate from an record of a person.
This is an example:
If John Smith birthdate falls between 4/1/1990 and 3/31/1991 then is a
"Tiger"
If John Smith birthdate falls between 4/1/1991 and 3/31/1992 then is a "Dog"
If John Smith birthdate falls between 4/1/1992 and 3/31/1993 then is a
"Monkey"

I would like to do this in a query. This would allow me to have it be
dynamic in a report. I guess I could add a field to assign in the personal
table but the query would be the preferred way.

Thanks
Tim



 




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

Similar Threads
Thread Thread Starter Forum Replies Last Post
x-post from previous question justin Using Forms 2 April 13th, 2005 09:48 PM
A report design question Al Setting Up & Running Reports 3 March 11th, 2005 09:41 PM
How to create a query with multiple answers to a question? Amit Running & Setting Up Queries 4 November 9th, 2004 04:52 PM
database design question e-mid Database Design 9 June 16th, 2004 09:42 PM
Word question regarding TOC (newbie question)... Herman Geerlings Formatting Long Documents 4 June 4th, 2004 03:12 PM


All times are GMT +1. The time now is 02:17 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.