Please help me in Qurey

  • Please help me regarding this qurey...

    SELECT Emp_EmployeeMain.EmployeeID, Emp_Attendance.TimeIN

    FROM Emp_EmployeeMain CROSS JOIN

    Emp_Attendance

    WHERE (Emp_Attendance.TimeOut IS NULL) AND (Emp_Attendance.TimeIN = '3/31/2009')

    I wait for you good response.

    Thanks in advance

    Best regards

    Waqar Hussain Laghari

  • syntax wise, your query is fine; you didn't say what the issue is you need help explaining.

    can you tell us what is wrong? does the query fail? do you need an explanation on what is a cross join?

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • This qurey does not show me records which are present.....

    if i remove the TimeIn = '3/31/2009' then it show me records...

    If you have idea about this..

    Best regards

    Waqar Hussain Laghari

  • I assume that the column TimeIN is a datetime column.

    Either there are no records for the date or more likely there is a time part along with the date part stored in the column. Ex: '3/31/2009 11:14:45.737' . Since you are not passing the time part its not returning any records.

    "Keep Trying"

  • are u sure u have records with this conditions.... TimeIn = '3/31/2009'

    seems like u must be storing time also with date

    try giving the condition "" TimeIn between '2009-03-31 00:00:00.000' and '2009-03-31 23:59:59' ""

    seems this will work , let me know if it not working then show us ur sample data...

    Mithun

  • How about providing table scripts, sample data and required output? Don't know how to post, click here to know[/url]

    --Ramesh


  • Dear Brothers thanks a lot.. Speacially Ramesh

    Best regards

    Waqar Hussain Laghari

    Software Engineer

  • I wonder why special thanks to me??, I didn't do anything special than others.

    --Ramesh


Viewing 8 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic. Login to reply