473,412 Members | 2,284 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,412 software developers and data experts.

To display IN time and OUT time in seperate fields

Hi,

I m working with access.we hav a table history stores the employee IN/OUT time details...The IN/OUT time details s stored in the same field as event time....I want to get the IN time and OUT time in seperate columns..
like below


IN OUT
9:00AM 6:00 PM

the 9:00AM nd 6:00 PM s stored in the same field as event....

can u help me?

Query

Expand|Select|Wrap|Line Numbers
  1. SELECT DISTINCT History.UserID, History.UserName, History.Dept, Shift_Mstr.Shift_InTime, History.EventTime, History.EventDate, Shift_Mstr.Shift_OutTime, History.EventTime
  2. FROM History INNER JOIN (Emp_Shift_Dtls INNER JOIN Shift_Mstr ON Emp_Shift_Dtls.Shift_Code = Shift_Mstr.Shift_Code) ON History.UserID = Emp_Shift_Dtls.EMP_ID
  3. WHERE (((History.Dept)="Engg") AND ((History.EventDate)=#2/24/2006#) AND ((History.FuncCode)="0") AND ((Emp_Shift_Dtls.Shift_Start_Date)<#2/24/2006#) AND ((Emp_Shift_Dtls.Shift_End_Date)>#2/24/2006#));

Here FunCode 0 is for IN time and 10 s for OUT time
Feb 26 '07 #1
3 1779
Rabbit
12,516 Expert Mod 8TB
Hi,

I m working with access.we hav a table history stores the employee IN/OUT time details...The IN/OUT time details s stored in the same field as event time....I want to get the IN time and OUT time in seperate columns..
like below


IN OUT
9:00AM 6:00 PM

the 9:00AM nd 6:00 PM s stored in the same field as event....

can u help me?

Query

Expand|Select|Wrap|Line Numbers
  1. SELECT DISTINCT History.UserID, History.UserName, History.Dept, Shift_Mstr.Shift_InTime, History.EventTime, History.EventDate, Shift_Mstr.Shift_OutTime, History.EventTime
  2. FROM History INNER JOIN (Emp_Shift_Dtls INNER JOIN Shift_Mstr ON Emp_Shift_Dtls.Shift_Code = Shift_Mstr.Shift_Code) ON History.UserID = Emp_Shift_Dtls.EMP_ID
  3. WHERE (((History.Dept)="Engg") AND ((History.EventDate)=#2/24/2006#) AND ((History.FuncCode)="0") AND ((Emp_Shift_Dtls.Shift_Start_Date)<#2/24/2006#) AND ((Emp_Shift_Dtls.Shift_End_Date)>#2/24/2006#));

Here FunCode 0 is for IN time and 10 s for OUT time
You said that In and Out time are stored in the same field as EventTime but what's this Shift_Mstr.Shift_InTime and Shift_Mstr.Shift_OutTime?
Feb 26 '07 #2
NeoPa
32,556 Expert Mod 16PB
Hi,

I m working with access.we hav a table history stores the employee IN/OUT time details...The IN/OUT time details s stored in the same field as event time....I want to get the IN time and OUT time in seperate columns..
like below


IN OUT
9:00AM 6:00 PM

the 9:00AM nd 6:00 PM s stored in the same field as event....

can u help me?

Query

Expand|Select|Wrap|Line Numbers
  1. SELECT DISTINCT History.UserID, History.UserName, History.Dept, Shift_Mstr.Shift_InTime, History.EventTime, History.EventDate, Shift_Mstr.Shift_OutTime, History.EventTime
  2. FROM History INNER JOIN (Emp_Shift_Dtls INNER JOIN Shift_Mstr ON Emp_Shift_Dtls.Shift_Code = Shift_Mstr.Shift_Code) ON History.UserID = Emp_Shift_Dtls.EMP_ID
  3. WHERE (((History.Dept)="Engg") AND ((History.EventDate)=#2/24/2006#) AND ((History.FuncCode)="0") AND ((Emp_Shift_Dtls.Shift_Start_Date)<#2/24/2006#) AND ((Emp_Shift_Dtls.Shift_End_Date)>#2/24/2006#));

Here FunCode 0 is for IN time and 10 s for OUT time
Conceptually, you use the GROUP BY clause to group similar items together, then you have two fields, one which selects only records whose type is an 'IN' and the other which selects only records whose type is an 'OUT'.
Feb 26 '07 #3
Thnks for Reply..But when I gave this query Its came like this

ShiftIn IN ShiftOut OUT
9:00AM 9:10 AM 6:00 PM 9;10 AM

same shift IN time is coming uder both IN and OUT....
But I got the Answer...The query S like below

SELECT DISTINCT h.UserID, h.UserName, h.EventDate, Shift_Mstr.Shift_InTime, h.EventTime AS InTime, Shift_Mstr.Shift_OutTime, h2.EventTime AS OutTime
FROM (History AS h LEFT JOIN History AS h2 ON (h.UserID = h2.UserID) AND (h.EventDate = h2.EventDate) AND (h.UserName = h2.UserName)) INNER JOIN (Shift_Mstr INNER JOIN Emp_Shift_Dtls ON Shift_Mstr.Shift_Code = Emp_Shift_Dtls.Shift_Code) ON h.UserID = Emp_Shift_Dtls.EMP_ID
WHERE (((h.EventDate)=#2/24/2006#) AND (([h.FuncCode])="0") AND (([h2.FuncCode])="10") AND ((Emp_Shift_Dtls.Shift_Start_Date)<=#2/24/2006#) AND ((Emp_Shift_Dtls.Shift_End_Date)>=#2/24/2006#));

ShiftIn IN ShiftOut OUT
9:00AM 9:10 AM 6:00 PM 6:00 PM
Feb 27 '07 #4

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

Similar topics

1
by: PeeZee | last post by:
I am having some trouble getting this done. I am able to get the value to display on a seperate page but not on the same page in the same form. I would like to display to set value of the radio...
8
by: Nick M | last post by:
Hello All, Excellent info here Thanks! I am very new to using access in general and I am on a learning curve. I'm trying to import an excel workbook (with worksheets) into an access db via a...
4
by: MCDONAMW | last post by:
First off, forgive me for being such a noob. I typically program vb.net, but I need to do some asp.net programming. I have something simple I have no idea how to do! I have an aspx page which...
4
by: mukeshhtrivedi | last post by:
I have TYPE field which has 3 data like HEAD, TRACK and PANEL. Now whenever any person works on HEAD we put 8 Hrs in HRS filed and in LABOR field it reflects the dollar value automatically like...
2
by: assgar | last post by:
Hi Developemnt on win2003 server. Final server will be linux Apache,Mysql and PHP is being used. I use 2 scripts(form and process). The form displays multiple dynamic rows with chechboxs,...
8
by: Lysander | last post by:
Hi, I am using Access 2003 I have seen some threads on how to select multiple values from a list box, but how do I display the selected options back again (Last time I used Access in anger, you...
36
by: beebelbrox | last post by:
Hi, I am new VB programming in Access and I am requesting help with the following code. WIndows OS MSaccess 2003 This code is attached to an unbound form that will display a specific recordset...
35
by: creative1 | last post by:
Hi everyone I am working on a project and have to connect mx3-usb magnetic card reader with buildin software installation facility. I want to collect customer information by their driving licence....
2
by: kummu4help | last post by:
Hi, i have a following form. <form id="frm_signup"> <b>please fill the following registration form.All the fields are compulsory</b><br/><br/> <table border="0" cellpadding=""...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.