February 19, 2015 at 5:14 am
hello,
this is my query
select convert(c.evs_OrderIDid as UNIQUEIDENTIFIER) , convert(b.ORdernumber as UNIQUEIDENTIFIER) from evs_ccagentCodes c
left join [salesorder] b on c.evs_OrderIDid = b.ORdernumber
its giving me this error
Msg 102, Level 15, State 1, Line 1
Incorrect syntax near 'UNIQUEIDENTIFIER'.
please help me out
immad
February 19, 2015 at 5:16 am
Change CONVERT to CAST
____________________________________________________
Deja View - The strange feeling that somewhere, sometime you've optimised this query before
How to get the best help on a forum
http://www.sqlservercentral.com/articles/Best+Practices/61537February 19, 2015 at 5:31 am
still giving m error
immad
February 19, 2015 at 5:32 am
What's your query now?
____________________________________________________
Deja View - The strange feeling that somewhere, sometime you've optimised this query before
How to get the best help on a forum
http://www.sqlservercentral.com/articles/Best+Practices/61537February 19, 2015 at 5:34 am
select cast(c.evs_OrderIDid as UNIQUEIDENTIFIER) , cast(b.ORdernumber as UNIQUEIDENTIFIER) from evs_ccagentCodes c
left join [salesorder] b on c.evs_OrderIDid = b.ORdernumber
immad
February 19, 2015 at 5:35 am
What error are you getting now?
____________________________________________________
Deja View - The strange feeling that somewhere, sometime you've optimised this query before
How to get the best help on a forum
http://www.sqlservercentral.com/articles/Best+Practices/61537February 19, 2015 at 7:38 pm
Anything that is not in the form of: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx where x is a hexadecimal value (e.g. 0-9 A-F) is going to fail... are c.evs_OrderIDid and b.ORdernumber formatted like that?
why do you need to make this conversion? Seems odd that you would need to do that...
-- Itzik Ben-Gan 2001
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply