Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
ragh
Starting Member
34 Posts |
Posted - 2005-06-01 : 23:29:27
|
Hi,I am getting this error, what measure can i take to solve this error.Also,How can i optimize this sceen, can someone help me please.---A Table with Rows as EmpID, Date, Time111 01/06/2005 0900112 01/06/2005 0900111 01/06/2005 1000112 01/06/2005 1600111 01/06/2005 1100-----I want to use this table and populate records as TimeIn and TimeOut in another table.Ex:Empid Date TimeIn TimeOut111 01/06/2005 0900 1000111 01/06/2005 1100 0 (employee didnt swiped as timeout)112 01/06/2005 0900 1600Can someone suggest me how can i do this....I'm doing it with coding thats making me get this error i guess, if anyone suggest me some SQL Query to accomplish this job, would really reduce my code as well as optimized too.regards,Ragh |
|
AndrewMurphy
Master Smack Fu Yak Hacker
2916 Posts |
Posted - 2005-06-02 : 06:32:51
|
You've a problem with your published table design.....You INFER/ASSUME, but cannot PROVE, that "111 01/06/2005 1100" was a CHECKIN time...it COULD have been a checkout time...with NO CHECKIN time.however...you could do something along the lines of this (if you fixed your datastructures)select a.empid, a.date, a.time, b.timefrom emptable aleft join emptable b on a.empid=b.empid and a.date = b.datewhere a.direction (new field!!!) = 'IN'and b.direction = 'OUT'alternatively, you need to get "a.time < b.time" |
 |
|
Merkin
Funky Drop Bear Fearing SQL Dude!
4970 Posts |
Posted - 2005-06-02 : 09:02:56
|
quote: what measure can i take to solve this error.
Write better code.Are you using an ADO recordset and calling the UPDATE method ? Usually that multistep error happens when you mismatch a datatype when setting a recordset field value.DamianIta erat quando hic adveni. |
 |
|
|
|
|
|
|