Query Join Error

thedeadzeds

Registered User.
Local time
Today, 03:28
Joined
Jan 8, 2014
Messages
40
Guys,

I have this query which works fine when sometimes but other times i get an error message? Also, when i run it via a report it does not pull through the name but it does on the query. Any ideas?

Code:
SELECT tblCalDates.CalDate, qry__approved_requests.Name, qry__approved_requests.datDatefrom, qry__approved_requests.datDateto
FROM tblCalDates LEFT JOIN qry__approved_requests ON (tblCalDates.CalDate = qry__approved_requests.datDateto) OR (tblCalDates.CalDate = qry__approved_requests.datDatefrom)
WHERE tblCalDates.CalDate=[Forms]![frm_check_dates]![txtCalDate];
 
Thanks Colin, I missed your reply so thank you so much for that. You have been a great help with this. I've attached a sample.

The query is qry_calender1. You will also notice that when you run the report rpt_calender1 is does not pull through the name.

Thanks again
 

Attachments

Thanks Annie, not really unfortunately. The current query qry_calender1 worked fine the main issue was a error message every now and again and the fact that the name was not displayed in the rpt_calender1 report.

So i bascially want the query to do the following:

Display the CalDate and based on the date selected in frm_check_dates and pull through any data which has an equal date in the datDatefrom or datDateto

So it would look like the below. This is what the query currently does but it did show an error at one point. I did write this query as SQL rather than in the builder so i'm not sure if this is the issue. Also, the name does not pull through in the rpt_calender1 report

attachment.php
 

Attachments

  • Capture4.PNG
    Capture4.PNG
    24.7 KB · Views: 194

Users who are viewing this thread

Back
Top Bottom