473,378 Members | 1,500 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

number value needs valid date range

I have a database that has a field [STD] (performance standard), every
year the standard changed which was not a problem since we start out
each year with a blank database and just change the standards based on
the prior years performance.
Now they threw me a curve ball... They want to change the standards
every quarter. This standard [STD] is matched up with an item that is
referenced in a daily production table to figure out our percentage of
productivity.
Based on the date of the production entry, we want to pull over the
standard for that time frame. To complicate things, we run reports for
the entire year, which would involve 4 different standards one from
each quarter.

Does anyone have any suggestion how this can be done??

Any assistance or direction is greatly appreciated.

Norma

Feb 2 '07 #1
4 2551
On Feb 2, 12:25 pm, norma.j.hildebr...@gsk.com wrote:
I have a database that has a field [STD] (performance standard), every
year the standard changed which was not a problem since we start out
each year with a blank database and just change the standards based on
the prior years performance.
Now they threw me a curve ball... They want to change the standards
every quarter. This standard [STD] is matched up with an item that is
referenced in a daily production table to figure out our percentage of
productivity.
Based on the date of the production entry, we want to pull over the
standard for that time frame. To complicate things, we run reports for
the entire year, which would involve 4 different standards one from
each quarter.

Does anyone have any suggestion how this can be done??

Any assistance or direction is greatly appreciated.

Norma
Create a table of [Standard], [BeginDate], [EndDate] or
[Standard], [Quarter], [Year]
and then join on those. Then you can grab the quarters/years that
apply to your date ranges by doing a simple join.

Feb 2 '07 #2
On Feb 2, 1:33 pm, "pietlin...@hotmail.com" <pietlin...@hotmail.com>
wrote:
On Feb 2, 12:25 pm, norma.j.hildebr...@gsk.com wrote:


I have a database that has a field [STD] (performance standard), every
year the standard changed which was not a problem since we start out
each year with a blank database and just change the standards based on
the prior years performance.
Now they threw me a curve ball... They want to change the standards
every quarter. This standard [STD] is matched up with an item that is
referenced in a daily production table to figure out our percentage of
productivity.
Based on the date of the production entry, we want to pull over the
standard for that time frame. To complicate things, we run reports for
the entire year, which would involve 4 different standards one from
each quarter.
Does anyone have any suggestion how this can be done??
Any assistance or direction is greatly appreciated.
Norma

Create a table of [Standard], [BeginDate], [EndDate] or
[Standard], [Quarter], [Year]
and then join on those. Then you can grab the quarters/years that
apply to your date ranges by doing a simple join.- Hide quoted text -

- Show quoted text -
Thanks for your response, but that seems too simple... (or I am
thinking too deep)
If each record has the fields containing: Item, Std, ItemType,
STDstartdate, STDenddate. Would I need a new record for each item for
each qrt?

Feb 2 '07 #3
On Feb 2, 1:33 pm, "pietlin...@hotmail.com" <pietlin...@hotmail.com>
wrote:
On Feb 2, 12:25 pm, norma.j.hildebr...@gsk.com wrote:


I have a database that has a field [STD] (performance standard), every
year the standard changed which was not a problem since we start out
each year with a blank database and just change the standards based on
the prior years performance.
Now they threw me a curve ball... They want to change the standards
every quarter. This standard [STD] is matched up with an item that is
referenced in a daily production table to figure out our percentage of
productivity.
Based on the date of the production entry, we want to pull over the
standard for that time frame. To complicate things, we run reports for
the entire year, which would involve 4 different standards one from
each quarter.
Does anyone have any suggestion how this can be done??
Any assistance or direction is greatly appreciated.
Norma

Create a table of [Standard], [BeginDate], [EndDate] or
[Standard], [Quarter], [Year]
and then join on those. Then you can grab the quarters/years that
apply to your date ranges by doing a simple join.- Hide quoted text -

- Show quoted text -
That sounds really simple. So, for each item, I need four different
date ranges. Would I need to have 4 records for each item to allow all
4 quarters of the year? I just am not grasping this.
My table structure currently looks something like this.

Item
ItemType
ItemBrand
PeopleNeededToProduce
Standard
etc
etc

Production table like this:

Date
ItemRan
ManhoursToProduce
TotalCompleted
etc
etc

When I join these tables currently it is by item. Now with the new
date for the standard, would I need 4 records for each item, each
record having the same item # but different date ranges that the
standard is valid for?
How would I join these using both item and date range?

Feb 2 '07 #4
If you currently have
Item
ItemType
ItemBrand
PeopleNeededToProduce
Standard
etc
and you want multiple [Standard] values based on date then you'll have
to split [Standard] off into a separate table, e.g.
Item
ItemType
ItemBrand
PeopleNeededToProduce
etc
Item
StartDate
EndDate
Standard
and yes, you'll need four rows for each [Item] if the [Standard] is to
change quarterly.

>How would I join these using both item and date range?
Something like this (untested):

SELECT <fieldsFROM ((tblProd
INNER JOIN tblItem ON tblItem.Item=tblProd.Item)
INNER JOIN tblStd ON tblStd.Item=tblItem.Item
AND tblStd.StartDate<=tblProd.[Date]
AND tblStd.EndDate>=tblProd.[Date])
WHERE <whatever>

On Feb 2, 2:20 pm, norma.j.hildebr...@gsk.com wrote:
On Feb 2, 1:33 pm, "pietlin...@hotmail.com" <pietlin...@hotmail.com>
wrote:
On Feb 2, 12:25 pm, norma.j.hildebr...@gsk.com wrote:
I have a database that has a field [STD] (performance standard), every
year the standard changed which was not a problem since we start out
each year with a blank database and just change the standards based on
the prior years performance.
Now they threw me a curve ball... They want to change the standards
every quarter. This standard [STD] is matched up with an item that is
referenced in a daily production table to figure out our percentage of
productivity.
Based on the date of the production entry, we want to pull over the
standard for that time frame. To complicate things, we run reports for
the entire year, which would involve 4 different standards one from
each quarter.
Does anyone have any suggestion how this can be done??
Any assistance or direction is greatly appreciated.
Norma
Create a table of [Standard], [BeginDate], [EndDate] or
[Standard], [Quarter], [Year]
and then join on those. Then you can grab the quarters/years that
apply to your date ranges by doing a simple join.- Hide quoted text -
- Show quoted text -

That sounds really simple. So, for each item, I need four different
date ranges. Would I need to have 4 records for each item to allow all
4 quarters of the year? I just am not grasping this.
My table structure currently looks something like this.

Item
ItemType
ItemBrand
PeopleNeededToProduce
Standard
etc
etc

Production table like this:

Date
ItemRan
ManhoursToProduce
TotalCompleted
etc
etc

When I join these tables currently it is by item. Now with the new
date for the standard, would I need 4 records for each item, each
record having the same item # but different date ranges that the
standard is valid for?
How would I join these using both item and date range?

Feb 2 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Aaron | last post by:
I need some help writing this function the function returns a list of random non-duplicate integers in a string, 1 parameter indicating the maximum range. string randGen(int maxRange) ...
20
by: Glenn Venzke | last post by:
I'm writing a class with a method that will accept 1 of 3 items listed in an enum. Is it possible to pass the item name without the enum name in your calling statement? EXAMPLE: public enum...
12
by: Susan Cranford | last post by:
Please forgive, I have looked at so much info I can't figure out how to put it together even though I know it must be fairly simple. I have an array of input text boxes (txtDOBn) where n is...
11
by: quickcur | last post by:
Suppose I have a function rand() that can generate one integer random number between 0 and 100. Suppose also rand() is very expensive. What is the fastest way to generate 10 different random number...
4
by: the hotshot | last post by:
hello, this seems to be a hard question so far and noone has been able to help with this. is it possible to have access start an autonumber with a prefix according to the year when the data is...
23
by: Davey | last post by:
How do I display an integer in binary format in C? e.g. 4 displayed as "100"
5
by: Jimmy | last post by:
How do I set the default value of a text box (date/time) to 1/1/Current Year... i.e 1/1/2006 this year, 1/1/2007 next year?
6
by: vdicarlo | last post by:
I am a programming amateur and a Python newbie who needs to convert about 100,000,000 strings of the form "1999-12-30" into ordinal dates for sorting, comparison, and calculations. Though my script...
2
by: srusskinyon | last post by:
I need some help getting unique records from our database! I work for a small non-profit homeless shelter. We keep track of guest information as well as what services we have offered for...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.