Results 1 to 2 of 2

Thread: Problem in SELECT with DATE RANGE

  1. #1
    Join Date
    Sep 2010
    Posts
    188

    Problem in SELECT with DATE RANGE

    Hi..

    I got a problem in my SELECT Statement:

    Code:
    SELECT DISTINCT IF(ISNULL(a.LOGIN), 'rdc', '') AS LOGIN_CLASS, IF(ISNULL(a.LOGOUT), 'rdc', '') AS LOGOUT_CLASS, a.EMP_NO, a.LOGIN, a.LOGOUT, CONCAT(LNAME, ',' , FNAME, ' ', MI, '.') AS FULLNAME
     FROM attendance.employee_attendance AS a JOIN hris.employment em ON (a.EMP_NO = em.EMP_NO AND em.STATUS = 'Reg Operatives') JOIN hris.personal AS p ON p.EMP_ID = em.EMP_ID
     WHERE a.LOGIN BETWEEN '2012-01-16' AND '2012-02-01' OR a.LOGOUT BETWEEN '2012-01-16' AND '2012-02-01' 
     OR ISNULL(a.LOGIN) OR ISNULL(a.LOGOUT) ORDER BY FULLNAME, a.LOGIN
    I attach the 2 image, first the sample attendance which I get the data base on my select query, and the sample get attendance which is the output.

    I notice that in the output from my query, the attendance with 2012-02-01 that has no logout did not displayed and also the NO LOGIN and LOGOUT .

    when i tried to select from 2012-01-16 t0 2012-02-02, the date 2012-02-01 was displayed., but I need to range it in 2012-01-16 to 2012-02-01 only.

    Thank you

    Thank you..
    Attached Images Attached Images

  2. #2
    Join Date
    Mar 2012
    Posts
    93
    if you find out you may run your sql query in mysql.. check your table fields and table name of your database..

Similar Threads

  1. Problem in Update with select
    By newphpbees in forum Client & Server Side Scripting (PHP, ASP, JavaScript)
    Replies: 1
    Last Post: 17 Apr 2012, 05:37 AM
  2. Issue in count date from date range
    By newphpbees in forum Client & Server Side Scripting (PHP, ASP, JavaScript)
    Replies: 0
    Last Post: 06 Mar 2012, 06:51 PM
  3. problem with indexes is SELECT query
    By Alx in forum Client & Server Side Scripting (PHP, ASP, JavaScript)
    Replies: 0
    Last Post: 22 May 2008, 12:15 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •