Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 13
Default Early Login, Last Logout

Hi all,

I have a timesheet dump which has a Column for EmpCode viz
0,1,2,3,4,5, etc..
Next column is for StatusID where status means 1 = Login & 2 = Logout.
Next Column is for Date & Time Stamp (Long format).

Since the Login & Logout Date& TimeStamp lie in a single column, i
want to calculate, for each EmpID, the earliest time he logged in &
last time he logged out for the SAME day....

Also, if someone knows a way to find if the respective dateTime falls
on a weekend or holiday...

if anyone has an idea using Worksheet function or VBA code to
accomplish this, please let me know....

EmployeeCode StatusID Time
-------------------------------------------------------------------
0 1 4/13/07 7:01 PM
0 1 4/16/07 1:03 PM
0 1 4/16/07 1:05 PM
1 1 4/2/07 4:03 PM
1 2 4/2/07 6:20 PM
1 1 4/5/07 10:14 AM
1 2 4/5/07 1:27 PM
1 1 4/5/07 5:52 PM
1 1 4/17/07 6:03 PM
1 2 4/17/07 6:39 PM
1 1 4/19/07 9:38 AM
1 2 4/19/07 6:02 PM
1 1 4/19/07 7:33 PM
1 2 4/19/07 8:12 PM
1 1 4/19/07 9:05 PM
1 2 4/19/07 10:10 PM
1 1 4/24/07 11:17 AM

Sheet2:
EmpCode Early Login Early Logout
---------------------------------------------------------------



Cheers!

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,081
Default Early Login, Last Logout

This fairly screams to be in a database, not in Excel. Microsoft has free
downloads of SQL Server 2005 Express. If you use that, load your data into a
table called Newsgroup, this query returns exactly what you want for the min
Login and max Logout for each day


SELECT
EmployeeID,
StatusCode,
CONVERT(nvarchar(15), [timestamp], 101) AS WorkDays,
CASE StatusCode
WHEN 1 THEN Min(TimeStamp)
ELSE Max(timeStamp)
end
from
dbo.Newsgroup
group by
EmployeeID,
StatusCode,
CONVERT(nvarchar(15), [timestamp], 101)
order by
EmployeeID, 3


"junoon" wrote:

Hi all,

I have a timesheet dump which has a Column for EmpCode viz
0,1,2,3,4,5, etc..
Next column is for StatusID where status means 1 = Login & 2 = Logout.
Next Column is for Date & Time Stamp (Long format).

Since the Login & Logout Date& TimeStamp lie in a single column, i
want to calculate, for each EmpID, the earliest time he logged in &
last time he logged out for the SAME day....

Also, if someone knows a way to find if the respective dateTime falls
on a weekend or holiday...

if anyone has an idea using Worksheet function or VBA code to
accomplish this, please let me know....

EmployeeCode StatusID Time
-------------------------------------------------------------------
0 1 4/13/07 7:01 PM
0 1 4/16/07 1:03 PM
0 1 4/16/07 1:05 PM
1 1 4/2/07 4:03 PM
1 2 4/2/07 6:20 PM
1 1 4/5/07 10:14 AM
1 2 4/5/07 1:27 PM
1 1 4/5/07 5:52 PM
1 1 4/17/07 6:03 PM
1 2 4/17/07 6:39 PM
1 1 4/19/07 9:38 AM
1 2 4/19/07 6:02 PM
1 1 4/19/07 7:33 PM
1 2 4/19/07 8:12 PM
1 1 4/19/07 9:05 PM
1 2 4/19/07 10:10 PM
1 1 4/24/07 11:17 AM

Sheet2:
EmpCode Early Login Early Logout
---------------------------------------------------------------



Cheers!


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 13
Default Early Login, Last Logout

hi Duke,

Thanks for your reply. However data reports are only created in Excel
& 2ndly i donot know Access.

Is there a possible worksheet function to sum up a day's DateTimestamp
based on an Employee's StatusID, Login=1 & Logout=2.

Note, Sometimes, either one of the 2 may be missing for a particular
day. (See table above.)

Cheers!



On May 9, 12:25 am, Duke Carey
wrote:
This fairly screams to be in a database, not in Excel. Microsoft has free
downloads of SQL Server 2005 Express. If you use that, load your data into a
table called Newsgroup, this query returns exactly what you want for the min
Login and max Logout for each day

SELECT
EmployeeID,
StatusCode,
CONVERT(nvarchar(15), [timestamp], 101) AS WorkDays,
CASE StatusCode
WHEN 1 THEN Min(TimeStamp)
ELSE Max(timeStamp)
end
from
dbo.Newsgroup
group by
EmployeeID,
StatusCode,
CONVERT(nvarchar(15), [timestamp], 101)
order by
EmployeeID, 3

"junoon" wrote:
Hi all,


I have a timesheet dump which has a Column for EmpCode viz
0,1,2,3,4,5, etc..
Next column is for StatusID where status means 1 = Login & 2 = Logout.
Next Column is for Date & Time Stamp (Long format).


Since the Login & Logout Date& TimeStamp lie in a single column, i
want to calculate, for each EmpID, the earliest time he logged in &
last time he logged out for the SAME day....


Also, if someone knows a way to find if the respective dateTime falls
on a weekend or holiday...


if anyone has an idea using Worksheet function or VBA code to
accomplish this, please let me know....


EmployeeCode StatusID Time
-------------------------------------------------------------------
0 1 4/13/07 7:01 PM
0 1 4/16/07 1:03 PM
0 1 4/16/07 1:05 PM
1 1 4/2/07 4:03 PM
1 2 4/2/07 6:20 PM
1 1 4/5/07 10:14 AM
1 2 4/5/07 1:27 PM
1 1 4/5/07 5:52 PM
1 1 4/17/07 6:03 PM
1 2 4/17/07 6:39 PM
1 1 4/19/07 9:38 AM
1 2 4/19/07 6:02 PM
1 1 4/19/07 7:33 PM
1 2 4/19/07 8:12 PM
1 1 4/19/07 9:05 PM
1 2 4/19/07 10:10 PM
1 1 4/24/07 11:17 AM


Sheet2:
EmpCode Early Login Early Logout
---------------------------------------------------------------


Cheers!



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,081
Default Early Login, Last Logout

If you fiddle around with your data - in particular adding a column with
formulas that return JUST the date portion of your date time value, then you
can probably get a Pivot table to give you what you need.

No matter what, you have lots of work to do in Excel.

To create the additional column of data, format the column as Date, then use
this formula:

=integer(cell with date time value)

That way you can group your data by date while preseving the original
datestamps




"junoon" wrote:

hi Duke,

Thanks for your reply. However data reports are only created in Excel
& 2ndly i donot know Access.

Is there a possible worksheet function to sum up a day's DateTimestamp
based on an Employee's StatusID, Login=1 & Logout=2.

Note, Sometimes, either one of the 2 may be missing for a particular
day. (See table above.)

Cheers!



On May 9, 12:25 am, Duke Carey
wrote:
This fairly screams to be in a database, not in Excel. Microsoft has free
downloads of SQL Server 2005 Express. If you use that, load your data into a
table called Newsgroup, this query returns exactly what you want for the min
Login and max Logout for each day

SELECT
EmployeeID,
StatusCode,
CONVERT(nvarchar(15), [timestamp], 101) AS WorkDays,
CASE StatusCode
WHEN 1 THEN Min(TimeStamp)
ELSE Max(timeStamp)
end
from
dbo.Newsgroup
group by
EmployeeID,
StatusCode,
CONVERT(nvarchar(15), [timestamp], 101)
order by
EmployeeID, 3

"junoon" wrote:
Hi all,


I have a timesheet dump which has a Column for EmpCode viz
0,1,2,3,4,5, etc..
Next column is for StatusID where status means 1 = Login & 2 = Logout.
Next Column is for Date & Time Stamp (Long format).


Since the Login & Logout Date& TimeStamp lie in a single column, i
want to calculate, for each EmpID, the earliest time he logged in &
last time he logged out for the SAME day....


Also, if someone knows a way to find if the respective dateTime falls
on a weekend or holiday...


if anyone has an idea using Worksheet function or VBA code to
accomplish this, please let me know....


EmployeeCode StatusID Time
-------------------------------------------------------------------
0 1 4/13/07 7:01 PM
0 1 4/16/07 1:03 PM
0 1 4/16/07 1:05 PM
1 1 4/2/07 4:03 PM
1 2 4/2/07 6:20 PM
1 1 4/5/07 10:14 AM
1 2 4/5/07 1:27 PM
1 1 4/5/07 5:52 PM
1 1 4/17/07 6:03 PM
1 2 4/17/07 6:39 PM
1 1 4/19/07 9:38 AM
1 2 4/19/07 6:02 PM
1 1 4/19/07 7:33 PM
1 2 4/19/07 8:12 PM
1 1 4/19/07 9:05 PM
1 2 4/19/07 10:10 PM
1 1 4/24/07 11:17 AM


Sheet2:
EmpCode Early Login Early Logout
---------------------------------------------------------------


Cheers!




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Showcase Query Login Nigel Excel Discussion (Misc queries) 0 March 28th 07 10:00 PM
Multiple Login Question. Red2003XLT Excel Discussion (Misc queries) 0 March 7th 07 02:44 PM
VBA Code to Login to Excel Gimp Excel Discussion (Misc queries) 1 February 16th 07 05:38 PM
Q:Excel/ODBC/Login .... MSweetG222 Excel Discussion (Misc queries) 1 July 24th 05 06:37 PM
Login Logout Date Problem ascool_asice Excel Worksheet Functions 2 May 30th 05 12:50 AM


All times are GMT +1. The time now is 03:09 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"