The following query yields 6 results:
SELECT ATTACHMENT_ID,
/* Somme other columns */
THUMBNAIL_EXIST,
CASE isnull ((SELECT TOP 1 EMAIL_ID
FROM EMAILS_ATTACHMENTS
WHERE ATTACHMENT_ID = vwFILES_ATTACHMENTS.ATTACHMENT_ID), '00000000-0000-0000-0000-000000000000')
WHEN '00000000-0000-0000-0000-000000000000' THEN '0'
ELSE '1'
END AS SENT_ATTACHMENT,
CASE File_ext
WHEN '.pdf' THEN 'true'
ELSE 'false'
END AS 'enablecheck',
CASE VISIBLE_TO_CLIENT
WHEN '1' THEN '/FACTS/App_Themes/SugarClassic/images/check_inline.gif'
ELSE '/FACTS/App_Themes/SugarClassic/images/close_inline.gif'
END AS 'VISIBLE_TO_CLIENT_PATH'
FROM vwFILES_ATTACHMENTS
WHERE ( 1 = 1 )
AND ( PARENT_TYPE = 'Files' )
AND ( PARENT_ID = '55e52006-ce85-4781-b6f9-00b68c04d62f' )
AND ( DELETED = 0 )
ORDER BY DATE_ENTERED DESC
I modified the DELETED column on one row changing it from False to True. When I try to search for DELETED = 1 instead of DELETED = 0, the search yields no results.
Why is the one row that I changed not showing up? I only get 5 results when I run my DELETED = 0 query (above). The 6th result is not retrieved until I search specifically for it’s ATTACHMENT_ID.
Thanks for your help.
It’s hard to determine what’s going on with your situation given the post and the comments. I would try something like this to determine your Deleted column values:
If that is returning you the correct results, then as dumb as it sounds, assuming Deleted = 1 does not work, try something like:
If either = 1 or <> 0 work and return the correct row, then chances are @Joel was correct with his assumptions that other constraints in your WHERE clause are causing it not to return. If = 1 or <> 0 do not work, then I’m clueless.
Good luck.