How to insert two recordsets if only two records shows up

G

Guest

Hello. In my query I need to insert two records set if the result has only
two recordset.

I need to insert on employees time table the time that they spend to launch
per day if that time don't exist.

Imagine this:
---------------------------------------------------------------------------------
Employe No. Date Time Description
1010 15-05-2007 08:00 In (starts
to works)
1010 15-05-2007 17:00 Out (quit
the work)

In that example it seams that the employee did not have the lauch time. In
that case I need to inser this:

---------------------------------------------------------------------------------
Employe No. Date Time Description
1010 15-05-2007 08:00 In (starts
to works)
1010 15-05-2007 13:00 Out (gone to
launch)
1010 15-05-2007 14:00 In (came
from launch)
1010 15-05-2007 17:00 Out (quit
the work)


but sometimes the launch time is register, so I don't need to do nothing
(see bellow
---------------------------------------------------------------------------------
Employe No. Date Time Description
1010 15-05-2007 08:00 In (starts
to works)
1010 15-05-2007 12:55 Out (gone to
launch)
1010 15-05-2007 13:55 In (came
from launch)
1010 15-05-2007 17:00 Out (quit
the work)


That time is register in another table it was even great if I was able to
load that time when this happens.

Please help me.

Not easy hein?? :)

Regards in advanced.

Marco
 
M

Michel Walsh

Have a table, Defaults, two fields, DefaultTime, DefaultDesc, two records:


DefaultTime, DefaultDesc
13:00:00 OUT for lunch (added)
14:00:00 IN from lunch (added)


then, the query:


INSERT INTO tableName(EmployeeNo, [Date], [Time], Description)
SELECT employeeNo, Date, DefaultTime, DefaultDesc
FROM tableName AS a, Defaults

WHERE 2 = (SELECT COUNT(*) FROM tableName As b
WHERE b.employeeNo=a.employeeNo
AND b.date=a.date
HAVING MAX(b.time) > (SELECT MIN(defaultTime) FROM
Defaults)
OR MIN(b.time) > (SELECT MAX(defaultTime)
FROM Defaults))

AND a.Time=(SELECT MIN(c.Time) FROM tableName AS c
WHERE c.EmployeeNo=a.EmployeeNo
AND c.Date=a.Date)






should do the work, assuming there is already 2 records, for a given date
(ex.: the employee did not forgot to punch out, doing so, there will be just
one record for a given date). Also, if there is two records, but the leaving
out time is less than 13:00:00. the two additional records are not added,
neither if, having only two records, if the in-time > 14:00:00, no two new
records are added.






Hoping it may help,
Vanderghast, Access MVP
 
G

Guest

JUST PERFECT. :)

Can I make one more question?

I have already a table that "merge" two other tables. So may qyestion is, is
it possoble to also ad this registers to that table? or table could enter in
loop?

Because I already had reports and other queries working.

Best Regards,
Marco

Check my changes:

INSERT INTO teste ( EmployeeNumber, Data_Ge, Hora_GE, Descricao )
SELECT employeenumber, Data_GE, DefaultTime, DefaultDesc
FROM teste AS a, Defaults
WHERE 2 = (SELECT COUNT(*) FROM teste As b
WHERE b.employeeNumber=a.employeeNumber
AND b.data_GE=a.data_GE
HAVING MAX(b.Hora_GE) > (SELECT MIN(defaultTime) FROM
Defaults)
OR MIN(b.Hora_GE) > (SELECT MAX(defaultTime)
FROM Defaults))

AND a.Hora_GE=(SELECT MIN(c.Hora_GE) FROM teste AS c
WHERE c.EmployeeNumber=a.EmployeeNumber
AND c.Data_GE=a.Data_GE);









Michel Walsh said:
Have a table, Defaults, two fields, DefaultTime, DefaultDesc, two records:


DefaultTime, DefaultDesc
13:00:00 OUT for lunch (added)
14:00:00 IN from lunch (added)


then, the query:


INSERT INTO tableName(EmployeeNo, [Date], [Time], Description)
SELECT employeeNo, Date, DefaultTime, DefaultDesc
FROM tableName AS a, Defaults

WHERE 2 = (SELECT COUNT(*) FROM tableName As b
WHERE b.employeeNo=a.employeeNo
AND b.date=a.date
HAVING MAX(b.time) > (SELECT MIN(defaultTime) FROM
Defaults)
OR MIN(b.time) > (SELECT MAX(defaultTime)
FROM Defaults))

AND a.Time=(SELECT MIN(c.Time) FROM tableName AS c
WHERE c.EmployeeNo=a.EmployeeNo
AND c.Date=a.Date)






should do the work, assuming there is already 2 records, for a given date
(ex.: the employee did not forgot to punch out, doing so, there will be just
one record for a given date). Also, if there is two records, but the leaving
out time is less than 13:00:00. the two additional records are not added,
neither if, having only two records, if the in-time > 14:00:00, no two new
records are added.






Hoping it may help,
Vanderghast, Access MVP


Marco said:
Hello. In my query I need to insert two records set if the result has only
two recordset.

I need to insert on employees time table the time that they spend to
launch
per day if that time don't exist.

Imagine this:
---------------------------------------------------------------------------------
Employe No. Date Time
Description
1010 15-05-2007 08:00 In (starts
to works)
1010 15-05-2007 17:00 Out (quit
the work)

In that example it seams that the employee did not have the lauch time. In
that case I need to inser this:

---------------------------------------------------------------------------------
Employe No. Date Time
Description
1010 15-05-2007 08:00 In (starts
to works)
1010 15-05-2007 13:00 Out (gone
to
launch)
1010 15-05-2007 14:00 In (came
from launch)
1010 15-05-2007 17:00 Out (quit
the work)


but sometimes the launch time is register, so I don't need to do nothing
(see bellow)
---------------------------------------------------------------------------------
Employe No. Date Time
Description
1010 15-05-2007 08:00 In (starts
to works)
1010 15-05-2007 12:55 Out (gone
to
launch)
1010 15-05-2007 13:55 In (came
from launch)
1010 15-05-2007 17:00 Out (quit
the work)


That time is register in another table it was even great if I was able to
load that time when this happens.

Please help me.

Not easy hein?? :)

Regards in advanced.

Marco
 
M

Michel Walsh

I am not sure I understand correctly, but it seems that it is a matter to
append the new records, in each table, BEFORE merging them.


Vanderghast, Access MVP


Marco said:
JUST PERFECT. :)

Can I make one more question?

I have already a table that "merge" two other tables. So may qyestion is,
is
it possoble to also ad this registers to that table? or table could enter
in
loop?

Because I already had reports and other queries working.

Best Regards,
Marco

Check my changes:

INSERT INTO teste ( EmployeeNumber, Data_Ge, Hora_GE, Descricao )
SELECT employeenumber, Data_GE, DefaultTime, DefaultDesc
FROM teste AS a, Defaults
WHERE 2 = (SELECT COUNT(*) FROM teste As b
WHERE b.employeeNumber=a.employeeNumber
AND b.data_GE=a.data_GE
HAVING MAX(b.Hora_GE) > (SELECT MIN(defaultTime) FROM
Defaults)
OR MIN(b.Hora_GE) > (SELECT MAX(defaultTime)
FROM Defaults))

AND a.Hora_GE=(SELECT MIN(c.Hora_GE) FROM teste AS c
WHERE c.EmployeeNumber=a.EmployeeNumber
AND c.Data_GE=a.Data_GE);









Michel Walsh said:
Have a table, Defaults, two fields, DefaultTime, DefaultDesc, two
records:


DefaultTime, DefaultDesc
13:00:00 OUT for lunch (added)
14:00:00 IN from lunch (added)


then, the query:


INSERT INTO tableName(EmployeeNo, [Date], [Time], Description)
SELECT employeeNo, Date, DefaultTime, DefaultDesc
FROM tableName AS a, Defaults

WHERE 2 = (SELECT COUNT(*) FROM tableName As b
WHERE b.employeeNo=a.employeeNo
AND b.date=a.date
HAVING MAX(b.time) > (SELECT MIN(defaultTime)
FROM
Defaults)
OR MIN(b.time) > (SELECT
MAX(defaultTime)
FROM Defaults))

AND a.Time=(SELECT MIN(c.Time) FROM tableName AS c
WHERE c.EmployeeNo=a.EmployeeNo
AND c.Date=a.Date)






should do the work, assuming there is already 2 records, for a given date
(ex.: the employee did not forgot to punch out, doing so, there will be
just
one record for a given date). Also, if there is two records, but the
leaving
out time is less than 13:00:00. the two additional records are not added,
neither if, having only two records, if the in-time > 14:00:00, no two
new
records are added.






Hoping it may help,
Vanderghast, Access MVP


Marco said:
Hello. In my query I need to insert two records set if the result has
only
two recordset.

I need to insert on employees time table the time that they spend to
launch
per day if that time don't exist.

Imagine this:
---------------------------------------------------------------------------------
Employe No. Date Time
Description
1010 15-05-2007 08:00 In
(starts
to works)
1010 15-05-2007 17:00 Out
(quit
the work)

In that example it seams that the employee did not have the lauch time.
In
that case I need to inser this:

---------------------------------------------------------------------------------
Employe No. Date Time
Description
1010 15-05-2007 08:00 In
(starts
to works)
1010 15-05-2007 13:00 Out
(gone
to
launch)
1010 15-05-2007 14:00 In
(came
from launch)
1010 15-05-2007 17:00 Out
(quit
the work)


but sometimes the launch time is register, so I don't need to do
nothing
(see bellow)
---------------------------------------------------------------------------------
Employe No. Date Time
Description
1010 15-05-2007 08:00 In
(starts
to works)
1010 15-05-2007 12:55 Out
(gone
to
launch)
1010 15-05-2007 13:55 In
(came
from launch)
1010 15-05-2007 17:00 Out
(quit
the work)


That time is register in another table it was even great if I was able
to
load that time when this happens.

Please help me.

Not easy hein?? :)

Regards in advanced.

Marco
 
G

Guest

OK, just leave it. I did a great help for me. If I can do anything for you
please just let me know. Thanks a lot. Really great.

I would like to make you antoher question regarding this problem.

I had to create this querie to be able to insert the time that the employee
must have to eat, but there's another problem who also does this. So my idea
is if it possible to copy from another table those registers. Instead of copy
from that default table as you said. So I ask if it possible to copy from
this registers:

----------------------------------------------------------------------
Empoyee Data Time Description
1010 15-05-2007 08:00 IN
1010 15-05-2007 12:50 Out
1010 15-05-2007 13:40 IN
1010 15-05-2007 18:00 Out

Is it possible to copy the registers of 12:50 and 13:40 instead from that
default table?

The lunch time in always the two middle records. Is it possible? Please say
yes. :)

By the way do you think that is possible to not insert if the registers are
two but the Out register is less or equal then 13:00H??

Please check my last post on queries.

If I have to pay you just let me know.

Thanks once again.

Regards,
Marco







Michel Walsh said:
I am not sure I understand correctly, but it seems that it is a matter to
append the new records, in each table, BEFORE merging them.


Vanderghast, Access MVP


Marco said:
JUST PERFECT. :)

Can I make one more question?

I have already a table that "merge" two other tables. So may qyestion is,
is
it possoble to also ad this registers to that table? or table could enter
in
loop?

Because I already had reports and other queries working.

Best Regards,
Marco

Check my changes:

INSERT INTO teste ( EmployeeNumber, Data_Ge, Hora_GE, Descricao )
SELECT employeenumber, Data_GE, DefaultTime, DefaultDesc
FROM teste AS a, Defaults
WHERE 2 = (SELECT COUNT(*) FROM teste As b
WHERE b.employeeNumber=a.employeeNumber
AND b.data_GE=a.data_GE
HAVING MAX(b.Hora_GE) > (SELECT MIN(defaultTime) FROM
Defaults)
OR MIN(b.Hora_GE) > (SELECT MAX(defaultTime)
FROM Defaults))

AND a.Hora_GE=(SELECT MIN(c.Hora_GE) FROM teste AS c
WHERE c.EmployeeNumber=a.EmployeeNumber
AND c.Data_GE=a.Data_GE);









Michel Walsh said:
Have a table, Defaults, two fields, DefaultTime, DefaultDesc, two
records:


DefaultTime, DefaultDesc
13:00:00 OUT for lunch (added)
14:00:00 IN from lunch (added)


then, the query:


INSERT INTO tableName(EmployeeNo, [Date], [Time], Description)
SELECT employeeNo, Date, DefaultTime, DefaultDesc
FROM tableName AS a, Defaults

WHERE 2 = (SELECT COUNT(*) FROM tableName As b
WHERE b.employeeNo=a.employeeNo
AND b.date=a.date
HAVING MAX(b.time) > (SELECT MIN(defaultTime)
FROM
Defaults)
OR MIN(b.time) > (SELECT
MAX(defaultTime)
FROM Defaults))

AND a.Time=(SELECT MIN(c.Time) FROM tableName AS c
WHERE c.EmployeeNo=a.EmployeeNo
AND c.Date=a.Date)






should do the work, assuming there is already 2 records, for a given date
(ex.: the employee did not forgot to punch out, doing so, there will be
just
one record for a given date). Also, if there is two records, but the
leaving
out time is less than 13:00:00. the two additional records are not added,
neither if, having only two records, if the in-time > 14:00:00, no two
new
records are added.






Hoping it may help,
Vanderghast, Access MVP


Hello. In my query I need to insert two records set if the result has
only
two recordset.

I need to insert on employees time table the time that they spend to
launch
per day if that time don't exist.

Imagine this:
---------------------------------------------------------------------------------
Employe No. Date Time
Description
1010 15-05-2007 08:00 In
(starts
to works)
1010 15-05-2007 17:00 Out
(quit
the work)

In that example it seams that the employee did not have the lauch time.
In
that case I need to inser this:

---------------------------------------------------------------------------------
Employe No. Date Time
Description
1010 15-05-2007 08:00 In
(starts
to works)
1010 15-05-2007 13:00 Out
(gone
to
launch)
1010 15-05-2007 14:00 In
(came
from launch)
1010 15-05-2007 17:00 Out
(quit
the work)


but sometimes the launch time is register, so I don't need to do
nothing
(see bellow)
---------------------------------------------------------------------------------
Employe No. Date Time
Description
1010 15-05-2007 08:00 In
(starts
to works)
1010 15-05-2007 12:55 Out
(gone
to
launch)
1010 15-05-2007 13:55 In
(came
from launch)
1010 15-05-2007 17:00 Out
(quit
the work)


That time is register in another table it was even great if I was able
to
load that time when this happens.

Please help me.

Not easy hein?? :)

Regards in advanced.

Marco
 
M

Michel Walsh

For the first part, yes, if you have, say, a table of defaults, but by
employee, and only these two records (or easily spotted records, maybe the
description is " Out for Lunch", and "In from Lunch".


Change

....
FROM tableName AS a, Defaults
WHERE 2 = (SELECT ...

into:

.....
FROM tableName AS a INNER JOIN DefaultsPerEmployee AS d
ON a.Employee = d.Employee

WHERE d.Description IN( "Out for Lunch", "In from Lunch")
AND 2= (SELECT ...




For the second part, from what I understand, it would be a matter to change:

HAVING MAX(b.time) > (SELECT MIN(defaultTime) FROM Defaults)


into

HAVING MAX(b.time) > #13:00#





Hoping it may help,
Vanderghast, Access MVP




Marco said:
OK, just leave it. I did a great help for me. If I can do anything for you
please just let me know. Thanks a lot. Really great.

I would like to make you antoher question regarding this problem.

I had to create this querie to be able to insert the time that the
employee
must have to eat, but there's another problem who also does this. So my
idea
is if it possible to copy from another table those registers. Instead of
copy
from that default table as you said. So I ask if it possible to copy from
this registers:

----------------------------------------------------------------------
Empoyee Data Time Description
1010 15-05-2007 08:00 IN
1010 15-05-2007 12:50 Out
1010 15-05-2007 13:40 IN
1010 15-05-2007 18:00 Out

Is it possible to copy the registers of 12:50 and 13:40 instead from that
default table?

The lunch time in always the two middle records. Is it possible? Please
say
yes. :)

By the way do you think that is possible to not insert if the registers
are
two but the Out register is less or equal then 13:00H??

Please check my last post on queries.

If I have to pay you just let me know.

Thanks once again.

Regards,
Marco







Michel Walsh said:
I am not sure I understand correctly, but it seems that it is a matter to
append the new records, in each table, BEFORE merging them.


Vanderghast, Access MVP


Marco said:
JUST PERFECT. :)

Can I make one more question?

I have already a table that "merge" two other tables. So may qyestion
is,
is
it possoble to also ad this registers to that table? or table could
enter
in
loop?

Because I already had reports and other queries working.

Best Regards,
Marco

Check my changes:

INSERT INTO teste ( EmployeeNumber, Data_Ge, Hora_GE, Descricao )
SELECT employeenumber, Data_GE, DefaultTime, DefaultDesc
FROM teste AS a, Defaults
WHERE 2 = (SELECT COUNT(*) FROM teste As b
WHERE b.employeeNumber=a.employeeNumber
AND b.data_GE=a.data_GE
HAVING MAX(b.Hora_GE) > (SELECT MIN(defaultTime) FROM
Defaults)
OR MIN(b.Hora_GE) > (SELECT MAX(defaultTime)
FROM Defaults))

AND a.Hora_GE=(SELECT MIN(c.Hora_GE) FROM teste AS c
WHERE c.EmployeeNumber=a.EmployeeNumber
AND c.Data_GE=a.Data_GE);









:

Have a table, Defaults, two fields, DefaultTime, DefaultDesc, two
records:


DefaultTime, DefaultDesc
13:00:00 OUT for lunch (added)
14:00:00 IN from lunch (added)


then, the query:


INSERT INTO tableName(EmployeeNo, [Date], [Time], Description)
SELECT employeeNo, Date, DefaultTime, DefaultDesc
FROM tableName AS a, Defaults

WHERE 2 = (SELECT COUNT(*) FROM tableName As b
WHERE b.employeeNo=a.employeeNo
AND b.date=a.date
HAVING MAX(b.time) > (SELECT MIN(defaultTime)
FROM
Defaults)
OR MIN(b.time) > (SELECT
MAX(defaultTime)
FROM Defaults))

AND a.Time=(SELECT MIN(c.Time) FROM tableName AS c
WHERE c.EmployeeNo=a.EmployeeNo
AND c.Date=a.Date)






should do the work, assuming there is already 2 records, for a given
date
(ex.: the employee did not forgot to punch out, doing so, there will
be
just
one record for a given date). Also, if there is two records, but the
leaving
out time is less than 13:00:00. the two additional records are not
added,
neither if, having only two records, if the in-time > 14:00:00, no two
new
records are added.






Hoping it may help,
Vanderghast, Access MVP


Hello. In my query I need to insert two records set if the result
has
only
two recordset.

I need to insert on employees time table the time that they spend to
launch
per day if that time don't exist.

Imagine this:
---------------------------------------------------------------------------------
Employe No. Date Time
Description
1010 15-05-2007 08:00 In
(starts
to works)
1010 15-05-2007 17:00 Out
(quit
the work)

In that example it seams that the employee did not have the lauch
time.
In
that case I need to inser this:

---------------------------------------------------------------------------------
Employe No. Date Time
Description
1010 15-05-2007 08:00 In
(starts
to works)
1010 15-05-2007 13:00 Out
(gone
to
launch)
1010 15-05-2007 14:00 In
(came
from launch)
1010 15-05-2007 17:00 Out
(quit
the work)


but sometimes the launch time is register, so I don't need to do
nothing
(see bellow)
---------------------------------------------------------------------------------
Employe No. Date Time
Description
1010 15-05-2007 08:00 In
(starts
to works)
1010 15-05-2007 12:55 Out
(gone
to
launch)
1010 15-05-2007 13:55 In
(came
from launch)
1010 15-05-2007 17:00 Out
(quit
the work)


That time is register in another table it was even great if I was
able
to
load that time when this happens.

Please help me.

Not easy hein?? :)

Regards in advanced.

Marco
 
G

Guest

Hello Michel.

Well. The other table that I want to get the records instead of defaults
table have almost always 4 records, and the 2 between/in the middle means the
lunch time with no particular time, can be at 13:15 to 14:00 or 12:50 to
13.10. probably is not possible to do that.

If I could copy those time, it was more correct instead of assuming that the
employee used one our or half an hour.

By the could you take a look on this post?:
http://www.microsoft.com/communitie...c502&mid=c6d51eb3-7495-4fd4-af77-c22bcb7bc502

Best regards,
Marco











Michel Walsh said:
For the first part, yes, if you have, say, a table of defaults, but by
employee, and only these two records (or easily spotted records, maybe the
description is " Out for Lunch", and "In from Lunch".


Change

....
FROM tableName AS a, Defaults
WHERE 2 = (SELECT ...

into:

.....
FROM tableName AS a INNER JOIN DefaultsPerEmployee AS d
ON a.Employee = d.Employee

WHERE d.Description IN( "Out for Lunch", "In from Lunch")
AND 2= (SELECT ...




For the second part, from what I understand, it would be a matter to change:

HAVING MAX(b.time) > (SELECT MIN(defaultTime) FROM Defaults)


into

HAVING MAX(b.time) > #13:00#





Hoping it may help,
Vanderghast, Access MVP




Marco said:
OK, just leave it. I did a great help for me. If I can do anything for you
please just let me know. Thanks a lot. Really great.

I would like to make you antoher question regarding this problem.

I had to create this querie to be able to insert the time that the
employee
must have to eat, but there's another problem who also does this. So my
idea
is if it possible to copy from another table those registers. Instead of
copy
from that default table as you said. So I ask if it possible to copy from
this registers:

----------------------------------------------------------------------
Empoyee Data Time Description
1010 15-05-2007 08:00 IN
1010 15-05-2007 12:50 Out
1010 15-05-2007 13:40 IN
1010 15-05-2007 18:00 Out

Is it possible to copy the registers of 12:50 and 13:40 instead from that
default table?

The lunch time in always the two middle records. Is it possible? Please
say
yes. :)

By the way do you think that is possible to not insert if the registers
are
two but the Out register is less or equal then 13:00H??

Please check my last post on queries.

If I have to pay you just let me know.

Thanks once again.

Regards,
Marco







Michel Walsh said:
I am not sure I understand correctly, but it seems that it is a matter to
append the new records, in each table, BEFORE merging them.


Vanderghast, Access MVP


JUST PERFECT. :)

Can I make one more question?

I have already a table that "merge" two other tables. So may qyestion
is,
is
it possoble to also ad this registers to that table? or table could
enter
in
loop?

Because I already had reports and other queries working.

Best Regards,
Marco

Check my changes:

INSERT INTO teste ( EmployeeNumber, Data_Ge, Hora_GE, Descricao )
SELECT employeenumber, Data_GE, DefaultTime, DefaultDesc
FROM teste AS a, Defaults
WHERE 2 = (SELECT COUNT(*) FROM teste As b
WHERE b.employeeNumber=a.employeeNumber
AND b.data_GE=a.data_GE
HAVING MAX(b.Hora_GE) > (SELECT MIN(defaultTime) FROM
Defaults)
OR MIN(b.Hora_GE) > (SELECT MAX(defaultTime)
FROM Defaults))

AND a.Hora_GE=(SELECT MIN(c.Hora_GE) FROM teste AS c
WHERE c.EmployeeNumber=a.EmployeeNumber
AND c.Data_GE=a.Data_GE);









:

Have a table, Defaults, two fields, DefaultTime, DefaultDesc, two
records:


DefaultTime, DefaultDesc
13:00:00 OUT for lunch (added)
14:00:00 IN from lunch (added)


then, the query:


INSERT INTO tableName(EmployeeNo, [Date], [Time], Description)
SELECT employeeNo, Date, DefaultTime, DefaultDesc
FROM tableName AS a, Defaults

WHERE 2 = (SELECT COUNT(*) FROM tableName As b
WHERE b.employeeNo=a.employeeNo
AND b.date=a.date
HAVING MAX(b.time) > (SELECT MIN(defaultTime)
FROM
Defaults)
OR MIN(b.time) > (SELECT
MAX(defaultTime)
FROM Defaults))

AND a.Time=(SELECT MIN(c.Time) FROM tableName AS c
WHERE c.EmployeeNo=a.EmployeeNo
AND c.Date=a.Date)






should do the work, assuming there is already 2 records, for a given
date
(ex.: the employee did not forgot to punch out, doing so, there will
be
just
one record for a given date). Also, if there is two records, but the
leaving
out time is less than 13:00:00. the two additional records are not
added,
neither if, having only two records, if the in-time > 14:00:00, no two
new
records are added.






Hoping it may help,
Vanderghast, Access MVP


Hello. In my query I need to insert two records set if the result
has
only
two recordset.

I need to insert on employees time table the time that they spend to
launch
per day if that time don't exist.

Imagine this:
---------------------------------------------------------------------------------
Employe No. Date Time
Description
1010 15-05-2007 08:00 In
(starts
to works)
1010 15-05-2007 17:00 Out
(quit
the work)

In that example it seams that the employee did not have the lauch
time.
In
that case I need to inser this:

---------------------------------------------------------------------------------
Employe No. Date Time
Description
1010 15-05-2007 08:00 In
(starts
to works)
1010 15-05-2007 13:00 Out
(gone
to
launch)
1010 15-05-2007 14:00 In
(came
from launch)
1010 15-05-2007 17:00 Out
(quit
the work)


but sometimes the launch time is register, so I don't need to do
nothing
(see bellow)
---------------------------------------------------------------------------------
Employe No. Date Time
Description
1010 15-05-2007 08:00 In
(starts
to works)
1010 15-05-2007 12:55 Out
(gone
to
launch)
1010 15-05-2007 13:55 In
(came
from launch)
1010 15-05-2007 17:00 Out
(quit
the work)


That time is register in another table it was even great if I was
able
to
load that time when this happens.

Please help me.

Not easy hein?? :)

Regards in advanced.

Marco
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top