Hi,
I'm attempting to compare information in a uniqueidentifier field using a
select statement and am having fits trying to get it to work.
Here's a sample of my SQL statement.
SELECT Organization.TreatAsTypeOf_ENUM, Organization.OrganizationID,
Organization.Organization, Organization.Email, Organization.URL,
Organization.Phone1, Organization.Phone2, Organization.ExternalAccountID,
Organization.CustomerTypeGUID_FK, Organization.BranchGUID_FK, Address.*,
CustomerType.* , Branch.BranchGUID, Branch.ParentBranchGUID
FROM (Organization LEFT JOIN Address ON Organization.BillToAddressGUID_FK =
Address.AddressGUID)
INNER JOIN CustomerType ON (Organization.BranchGUID_FK =
CustomerType.BranchGUID_FK) AND (Organization.CustomerTypeGUID_FK =
CustomerType.CustomerTypeGUID)
INNER JOIN Branch ON (Organization.BranchGUID_FK = Branch.BranchGUID)
WHERE Branch.ParentBranchGUID = '{65F02099-8E4C-4483-91B8-90AEF2838E76}' AND
CustomerTypeID = 'Home Owner ' ORDER BY Organization.OrganizationID
The part I'm having issue with is the WHERE statement. When I try to open
the recordset I get this error:
Syntax error converting from a character string to uniqueidentifier.
If I compare a uniqueidentifier to another one it works but if I try to save
the information and use it, I can't get it to work.
I'm doing this in VB and would LOVE some assistance. This is making me
crazy and I can't find any information on the web.
Thanks
Sue
Eric Isaacs - 23 Jul 2008 04:08 GMT
You shouldn't need the braces, the { or }, when doing the comparison:
WHERE Branch.ParentBranchGUID =
'65F02099-8E4C-4483-91B8-90AEF2838E76' ...
-Eric Isaacs
Suzette - 23 Jul 2008 04:44 GMT
Thanks, I tried several things but didn't remove the braces.
That worked.
Sue
> You shouldn't need the braces, the { or }, when doing the comparison:
>
> WHERE Branch.ParentBranchGUID =
> '65F02099-8E4C-4483-91B8-90AEF2838E76' ...
>
> -Eric Isaacs
Mariano Gomez - 24 Jul 2008 07:20 GMT
Where Branch.ParentBranchGUID = convert(uniqueidentifier,
'65F02099-8E4C-4483-91B8-90AEF2838E76')
Best regards,
--
MG.-
Mariano Gomez, MIS, MCP, PMP
Maximum Global Business, LLC
http://www.maximumglobalbusiness.com
> Hi,
>
[quoted text clipped - 33 lines]
>
> Sue