If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Other > Help with left join

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-28-05, 20:41
sophistLady sophistLady is offline
Registered User
 
Join Date: Feb 2005
Posts: 2
Question Help with left join

Hi, I have 2 tables in Ms Access. I am doing a tasklist application. I am using left join because I want all the records in the left table to be displayed. I almost get what I want but there is one thing that I cant figure out how to do.

Table name: SampleTask
Column names: taskID (pk), taskTime, taskName, taskDescription, taskPictorial, Monday, Tuesay....Sunday

Table name: SampleUser
Column names: userID, taskID, timeCompleted, taskStatus, taskDate

This is my sql statement of the left join..
SELECT SampleTask.taskID, SampleTask.taskTime, SampleTask.taskName, SampleUser.userID, SampleUser.taskStatus FROM SampleTask LEFT JOIN SampleUser ON SampleTask.taskID = SampleUser.taskID WHERE " & strDay & " = true ORDER BY SampleTask.taskTime, SampleTask.taskID

If i put.....WHERE " & strDay & " = true AND SampleUser.taskDate = '28/02/2005'.....then it will return me only the records with 28/02/2005. But that is not what I want.

What I want to display is to show all the tasks for today with the userID regardless of whether they have a record in User if "taskDate = today's date"

Any help would be great. Thank you in advance.
Reply With Quote
  #2 (permalink)  
Old 03-01-05, 00:51
RedAxl RedAxl is offline
Registered User
 
Join Date: Nov 2004
Posts: 39
Your statements are a bit confusing!
you said that...
Quote:
If i put.....WHERE " & strDay & " = true AND SampleUser.taskDate = '28/02/2005'.....then it will return me only the records with 28/02/2005. But that is not what I want.
Quote:
What I want to display is to show all the tasks for today with the userID regardless of whether they have a record in User if "taskDate = today's date"
I assume that "today's date" you are saying is 28/02/2005,
I don't see anything wrong in the results returned:
Quote:
only the records with 28/02/2005.
since this is the only date that will qualify to your condition/requirement:
Quote:
all the tasks for today with the userID regardless of whether they have a record in User if "taskDate = today's date"
You must be very specific to what you want, or better give us illustration (sample set of records and the result you want).

Red
Reply With Quote
  #3 (permalink)  
Old 03-01-05, 02:58
sophistLady sophistLady is offline
Registered User
 
Join Date: Feb 2005
Posts: 2
I have got the solution. Thanx anyway.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On