troubleshooting Question

why does this straightforward left join query, return null values for strings and dates?

Avatar of intellisource
intellisourceFlag for South Africa asked on
MySQL Server
3 Comments1 Solution303 ViewsLast Modified:
hi everybody,

i am currently having issues with the following left join select. the dateadd and the current timestamp are included in the selection to filter out the results but obviously it would not work as the logic dictates because the tables return null for all joins! attached you would find an xsl workbook with a page for the Faulty Query, as well as the individual tables selecting from.

SELECT 
	CURRENT_TIMESTAMP AS CURDATE, 
	ADDDATE(
		CS.timestamp_SurveyDateCreated, 
		INTERVAL ST.tinyint_ResendInterval DAY
	) AS OFFDATE, 
	C.*, 
	SL.*, 
	SP.* 
FROM 
	21_consumersurveys CS 
LEFT JOIN (
	19_consumers C, 
	25_serviceleads SL, 
	10_serviceprospects SP, 
	20_surveytypes ST 
) ON (
	CS.bigint_ConsumerID = C.bigint_ConsumerID AND 
	CS.bigint_LeadID = SL.bigint_LeadID AND 
	CS.bigint_ReferenceID = SP.bigint_ProspectID AND 
	CS.bigint_SurveyType = ST.bigint_SurveyID
)

Open in new window


the where part of the statement is supposed to look as follows:

WHERE 
	OFFDATE <= CURDATE AND 
	CS.tinyint_SurveyStatus = 0;

Open in new window


please tell me if you can see the issue, i do not seem to find a resolution here...
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 3 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros