Employee timecard implementation: Need help for db select query

Closed

Hello,

I am implementing basic employee time management functionality where I need your help in creating a data base query to

look up last action performed by the user. I have never done any SQL programming so your help would be appreciated.

My Table is: TimeCards

Id int primarykey,notnull

TimeStamp datetime notnull

Action tinyint not null,

User_Id int FK ([url removed, login to view], not null)

I have a class TimeCardEntry as below

class TimeCardEntry : IEntity

{

enum TimeCardAction

{

None = 0,

ClockIn = 1,

ClockOut = 2;

}

public TimeCardEntry(User user, TimeCardAction action)

{

_user = user;

Action = (int)action;

TimeStamp = [url removed, login to view];

}

public int Id { get; set; }

public int Action { get; set;}

public DateTime TimeStamp { get; set;}

public User User { get { return _user; } set { _user = value; }

private User _user;

}

I need to retrieve a last entry from TimeCards table where

1. [url removed, login to view]

2. [url removed, login to view] > [url removed, login to view] (Basically last entry today 12:00 AM)

I tried following function but getting exception.

TimeCardEntry GetLastTimeCardEntry(User user)

{

var entry = [url removed, login to view](x=> x, (x=> [url removed, login to view] == [url removed, login to view] && ([url removed, login to view]([url removed, login to view], [url removed, login to view]) > 0)).Last()

return entry;

}

Skills: Database Administration, MySQL, Software Architecture, SQL, Visual Basic

See more: need sql help, need help in programming, need help for programming, look for employee, i need help programming, i need employee, i need data entry done today, help in programming, employee need, c programming enum, base exception, visual basic programming help, my sql data base, i need a employee, getting help for c++ programming, data base programming, select, get sql help, employee, db query, sql retrieve table, sql select select, data base basic, 2013 query, sql management base

Project ID: #4310100

20 freelancers are bidding on average $53 for this job

weonlydo

Hi I can help you with this. We can start once you award me the project. Thanks

$60 USD in 1 day
(37 Reviews)
5.5
thanhlongfree

HI. I can do this for you

$30 USD in 1 day
(12 Reviews)
4.9
rajibdebslg

Hi, I am very interested for this job. Thanks. Rajib

$50 USD in 5 days
(22 Reviews)
4.4
rajhansh

I have 7+ experience in SQL programming. Have already developed the SQL code for you. Let me know if you are interested so that I can provide the code to you.

$30 USD in 0 days
(19 Reviews)
4.2
gatiworks

I can work with you on this

$60 USD in 1 day
(29 Reviews)
4.0
Pharoa

Thanks for the opportunity to bid on your project. I have very strong SQL Query skills along with enterprise applications development skills. I am available to begin immediately should you elect to award the proj More

$100 USD in 1 day
(1 Review)
3.7
bogdaniulian

Hello, please see my message.

$30 USD in 1 day
(9 Reviews)
3.7
Dekken

Sent you a PM.

$100 USD in 1 day
(4 Reviews)
3.4
srdas2012

Hi,Please Check PMB

$40 USD in 2 days
(6 Reviews)
2.6
bubu77

Hi, Database expert having 8+ years of IT experience. I belive I will be able to help you. Please see your PM for more details.

$75 USD in 2 days
(1 Review)
2.0
softdir

Hi, I am ready if you are.

$100 USD in 1 day
(2 Reviews)
1.6
kamtrivedi

OK. Let do it now. Expert here in SQL Quires.

$50 USD in 2 days
(1 Review)
0.2
nareshphuloria

Hi, I am an expert in Microsoft Technologies and would like to offer you my services. Please let me know if we can work together.

$60 USD in 2 days
(0 Reviews)
0.0
bbrundige

I can write a couple of queries to show you a couple of ways to achieve what you are looking for. I assume it will be a parameter driven query that you can use inline, or call through a stored procedure. I will write t More

$30 USD in 1 day
(0 Reviews)
0.0
FreelancerLLC

I am SQL and Linq expert. I can get it delivered with your specs.

$65 USD in 1 day
(0 Reviews)
0.0
Neeraj1987

Sir, I have done this task on my end, and i can share it with you on a minimal price.

$30 USD in 1 day
(0 Reviews)
0.0
rolfraj

Hi Latinpos, I have experience of 2 years in .net and 3 years in sql.please refer pm for more details Let us start. Regards, Raj.

$50 USD in 1 day
(0 Reviews)
0.0
riskypathak

Hi This one is really simple. You are just making a simple mistake. I have solved problem and had sent you answer in message. Please check.

$30 USD in 1 day
(0 Reviews)
0.0
miketek

Dear Sir, If I understood, you only need a SQL Query to return the last check time of an user id. I would be glad to apply for the minimum fee you have stated. Thank you in advance, Best Regards, Miguel More

$30 USD in 3 days
(0 Reviews)
0.0
omarkhabbas

i can do it very quickly, simple and direct.

$30 USD in 1 day
(0 Reviews)
0.0