473,378 Members | 1,417 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.

Need Access 2003 to look at a date and catagorize it as a production week

I am creating a database where an excel spreadsheet will be imported and then different information will be taken from that spreadsheet to give different reports and graphs. I am having a problems with the graphs but right now my biggest concern is that a date will be inputed and I need Access to read that date and then catagorize it as a production week. First week in March being Production Week 1. I know how to do this writing a lot of little queries where if it falls between this date and that date to make another column say Production Week #. However I am sure there has to be a much simpler way to do this. Does anyone have any suggestions or advice to help me with this?
Thanks
Nov 15 '06 #1
4 1328
cyberdwarf
218 Expert 100+
Hi Amanda

Just a thought...

Might be quicker to work out the date of each Monday for your production weeks, then enter these into a small table, along with their week numbers.

You could then take your input date, calculate the day of the week, deduct as many days as necessary to get to Monday.

Simple matter to look up that date in the table and pull out the week number

HTH

Steve
Nov 15 '06 #2
Steve
Thanks for trying to help. This is another idea. However this will be an ongoing thing. They will be importing this information weekly and one of the graphs will show information for that production week alone but the others show for production weeks during the past year.
Therefore I will need all this to update each time it has been imported and was hoping I could find a way where it would know without me having to go back in each year and write a new set of queries or make a new table.
I really appreciate your help though. I will keep this in mind.
Thanks again
Amanda
Nov 15 '06 #3
MMcCarthy
14,534 Expert Mod 8TB
I am creating a database where an excel spreadsheet will be imported and then different information will be taken from that spreadsheet to give different reports and graphs. I am having a problems with the graphs but right now my biggest concern is that a date will be inputed and I need Access to read that date and then catagorize it as a production week. First week in March being Production Week 1. I know how to do this writing a lot of little queries where if it falls between this date and that date to make another column say Production Week #. However I am sure there has to be a much simpler way to do this. Does anyone have any suggestions or advice to help me with this?
Thanks
You need to use the following function to establish the week number.

DatePart ( interval, date, [firstdayofweek], [firstweekofyear])

e.g.

DatePart ("ww", [DateFieldName], vbSunday, #01/03/2006#)

Just a couple of things regarding the last date in this formula #01/03/2006#.

I use european formula rather than US change it if appropriate.

Also you may need to change slightly depending on how you establish week 1. I think this will return as week 1 the week that has March 1st anywhere in it. If you only want the first full week of March try changing the date to 7th March and this should solve your problem. Test it out.
Nov 15 '06 #4
MMcCarthy
14,534 Expert Mod 8TB
BTW you can now use this as part of an query. e.g.

SELECT DatePart ("ww", [DateFieldName], vbSunday, #01/03/2006#) As WeekNo
FROM TableName;


You need to use the following function to establish the week number.

DatePart ( interval, date, [firstdayofweek], [firstweekofyear])

e.g.

DatePart ("ww", [DateFieldName], vbSunday, #01/03/2006#)

Just a couple of things regarding the last date in this formula #01/03/2006#.

I use european formula rather than US change it if appropriate.

Also you may need to change slightly depending on how you establish week 1. I think this will return as week 1 the week that has March 1st anywhere in it. If you only want the first full week of March try changing the date to 7th March and this should solve your problem. Test it out.
Nov 15 '06 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Craig Bates | last post by:
Hi Guys I have recently been learning SQL from a book whose examples used the Oracle engine. I have now made an Access database containing information for English Football fixtures. I am using...
4
by: Brian Coy | last post by:
I have a database that records a part no, a scrap reason, the cost of scrapping that item, and the date. I need to porduce a report that will show up to a weeks worth of data at a time, but I need...
3
by: Todd D. Levy | last post by:
I want to be able to determine (from a date entered by the user) what the Day of the Week is for that date. Does MS Access have that function? If it makes any difference, I am using Access...
4
by: Alicia | last post by:
I am having a problem grouping by week. I am looking for the simpliest way of doing it in Microsoft Access. I have tried to use a pre-loaded calender, access did not like it at all. If there is...
3
by: Alicia | last post by:
Hi, I am trying to match two queries and make it into one query. I have only been about to group similar attributes but nothing that looks like the FinalQuery below. If anyone knows of a query...
5
by: Alicia | last post by:
Hello everyone based on the data, I created a union query which produces this. SELECT ,,, 0 As ClosedCount FROM UNION SELECT ,, 0 AS OpenedCount, FROM ORDER BY , ;
1
by: Doug Lim | last post by:
I have an ASP.NET application that I've developed using Visual Studio ..NET 2003 and I'm making use of Crystal Reports for .NET that's included to return reports back to the visitor's web browser...
14
by: Tina | last post by:
My employer tracks productivity/performance of clinicians (how much they bill) each week, its averages for the month, and the 6 months. These averages are compared to their expected productivity....
2
by: eskelies | last post by:
Hello all. I am very new to this and I don't know if VBA is the better route to go. First and foremost I am running Access 2003. I have a table in my Access database. This table is made up of...
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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.