Microsoft Access Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseMicrosoft Access Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old January 9th, 2004, 02:01 AM
paulphonak paulphonak is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Location: Leeds, UK
Posts: 21 paulphonak User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 m 58 sec
Reputation Power: 0
Lightbulb Report: time sort based on night shift

I created a form showing an employee's work at every hour through his shift. There is two shifts - 6am-2pm, 2pm-10pm, and 10pm-6am. The hours for the night shift were in correct order ie. 22:00, 23:00, 00:00, 01:00, 06:00. Then I created a query for a report to ask me to select which day I wanted. The report showed the hours of 6-2 and 2-10 in correct order, but for 10-6 hours, it showed the night and morning hours the other way round. All those shifts were based on a same day date. How can I get the correct order?

Reply With Quote
  #2  
Old January 9th, 2004, 09:21 AM
sbaxter sbaxter is offline
Moderator: Access, SQL
ASP Free God (5000 - 5499 posts)
 
Join Date: Oct 2003
Posts: 5,126 sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 1 h 2 m 51 sec
Reputation Power: 12
If I understand you correctly You want to have the next morning hours (part of yesterdays Night shift) show up as part of yesterdays print out.

To do this you will need to field

Field One
WorkDate -> The date the shift started (for date selection)

Field Two
ShiftHour -> the Actutal Date and time of the shift (for sorting)

This way when you select the date of the work you will get the right date and will still be able to sort and get it to show up 23:00, 24:00, 01:00, 02:00, etc

S-

Reply With Quote
  #3  
Old January 12th, 2004, 11:17 PM
paulphonak paulphonak is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Location: Leeds, UK
Posts: 21 paulphonak User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 m 58 sec
Reputation Power: 0
Unhappy Time sort based on shift

Thanks for the reply. But I was not sure how to apply it to my database. Maybe if you look at the attached and see if the problem can be solved. Run the report.

Thanks.

Paul
Attached Files
File Type: zip dss log.zip (28.5 KB, 173 views)

Reply With Quote
  #4  
Old January 13th, 2004, 10:05 AM
sbaxter sbaxter is offline
Moderator: Access, SQL
ASP Free God (5000 - 5499 posts)
 
Join Date: Oct 2003
Posts: 5,126 sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 1 h 2 m 51 sec
Reputation Power: 12
This is what I would do:


In Dss Detail

Make the primary key a combiniation of:
DSS on Duty
ShiftDate (Not Date and TIme)

-if you need to keep the shift start time keep it in a seperate field
-The reason for the concatenated key is becuase you current design only allow one person to be logged into a shift at a time and that may not always be the case in the future. Plus you allow this system to be eventually be used of other purposes down the road by makeing it flexible (For example, right now you are only tracking DDS personnal, why not track the people under them as well or other personnal groups?)



In Job Detail
Make the following concatenated primary key
DSS on Duty
ShiftDate
JobDateAndTime



Now when you want to print you detail report for a particualar day of the year

You will specify the ShiftDate and question (once) and sort the report by JobDateAndTime


What even you do with your design, make it flexible, and make it work properly. There isn't a way to get your current design to print the report the way you want it. You have to change your design to whatever meets your system needs and you know what they are so change it to meet those needs. If you have any what-if or other questions ask away.



Off the subject, by word of advise, you shouldn't have a table without a primary key (Access Doesn't like that and it will give you problems later down the road). And even though Access can handle spaces in the TableNames and FieldNames, don't. It makes the DB harder to use as it becomes more complex in programming as your needs become more complex.

S-

Reply With Quote
  #5  
Old January 14th, 2004, 11:22 PM
paulphonak paulphonak is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Location: Leeds, UK
Posts: 21 paulphonak User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 m 58 sec
Reputation Power: 0
Lightbulb time sort based on night shift

Thanks for the information.

I think I loosely applied your instructions and report produced the results I wanted. Now is there any way to avoid having to type the date every a job is carried out? It would be a great pain if a person carried out 20+ jobs during his shift.

See attached file and advise me.

Many thanks!

Paul
Attached Files
File Type: zip db1.zip (38.2 KB, 152 views)

Reply With Quote
  #6  
Old January 15th, 2004, 10:58 AM
sbaxter sbaxter is offline
Moderator: Access, SQL
ASP Free God (5000 - 5499 posts)
 
Join Date: Oct 2003
Posts: 5,126 sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 1 h 2 m 51 sec
Reputation Power: 12
Here is two options

1
Create a text box that you will enter the current data in automatically. Then as you update the time in your sub form, after the users is done entering in the time, automatically add the date to the time for th user using VBA code in the AFter Update Event of the text box. The will work well for every shift but the night shift. (they will have to change that date to reflect the date that the time is for)


2 (my preference, but maybe not yours)

Don't use bound forms
I prefer to use Unbound forms with VBA code. Asuming that you are capturing the time when the finish the project or shift. I would create form (driven by barcodes) the they woudl scan the employee ID, and the job then were performing and have the system determien the current time and date and automatically add the information. if you can't use barcode, they can key their employee id and job/process ID have the system do the same thing. (this process may not fit you manufactuing process but it will give you an idea of other ways to do this)

S-

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseMicrosoft Access Help > Report: time sort based on night shift


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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 On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway