Click here to Skip to main content
11,427,946 members (58,914 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# ASP.NET MySQL
hi all

my table like:
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
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:
 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
 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 26-Sep-12 7:09am

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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

So your query is working correctly.
  Permalink  
Comments
tulasiram3975 at 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)



Advertise | Privacy | Mobile
Web03 | 2.8.150428.2 | Last Updated 26 Sep 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100