Click here to Skip to main content
15,881,588 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi all

my table like:
HTML
uid empid datetime
 1  9003  2012-09-26 09:20:00
 3  9000  2012-09-26 09:20:00
 4  9004  2012-09-26 09:20:00
 5  9002  2012-09-26 09:20:00 
 7  9001  2012-09-26 09:20:00
 18 9004  2012-09-25 09:15:00
 17 9000  2012-09-25 09:15:00
 11 9004  2012-09-26 08:59:00
 12 9002  2012-09-26 08:59:00
 15 9003  2012-09-25 09:15:00
 14 9001  2012-09-26 08:59:00
 19 9002  2012-09-25 09:15:00
 21 9001  2012-09-25 09:15:00

i have written query like
SQL
select * from attlog where TIME(datetime )>='09:00:00' and empid not in (select empid from attlog where TIME( datetime )<'09:00:00') AND DATE_FORMAT(DATE( datetime ) , '%m/%d/%Y' ) BETWEEN '09/25/2012' AND '09/26/2012' 

but i need to get datetime to check entries made after 9 but not before 9

now it is show like:
HTML
uid empid datetime
1  9003 2012-09-26 09:20:00
3  9000 2012-09-26 09:20:00
17 9000 2012-09-25 09:15:00
15 9003 2012-09-25 09:15:00

but it has to show like
HTML
uid empid datetime
1  9003 2012-09-26 09:20:00
3  9000 2012-09-26 09:20:00
18 9004 2012-09-25 09:15:00
17 9000 2012-09-25 09:15:00
15 9003 2012-09-25 09:15:00
19 9002 2012-09-25 09:15:00
21 9001 2012-09-25 09:15:00
22 9000 2012-09-25 09:15:00
23 9003 2012-09-25 09:15:00

am out of ideas... please can any one help me
thanks in advance
Posted

1 solution

"After 9 and not before 9" are mutually exclusive and is equal to ">9:00"

So your query is working correctly.
 
Share this answer
 
Comments
tulasiram3975 26-Sep-12 13:07pm    
it not working correctly if so it needs to fetch 25th date after details employee details should show but it won't i think need to change query condition..
i tried in different ways but am not getting accurate result

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900