I got an error 13 "Cannot resolve collation conflict for
equal to operation"
when trying to run some tasksThat means, you are trying to compare two character columns in your query,
but those columns are of different collations and hence the error.
Unless there's a good reason, all columns in the database should be of the
same collation. If you do need to have a different collation, then you need
to take care of that situation using the COLLATE keyword, in your queries.
if you run sp_help on the tables in question, you will see what collations
are being used by the table columns.
Look up SQL Server Books Online for more informaiton on collations and
COLLATE.
--
HTH,
Vyas, MVP (SQL Server)
http://vyaskn.tripod.com/
Is .NET important for a database professional?
http://vyaskn.tripod.com/poll.htm
"krasi" <krkrastev@.tbicredit.bg> wrote in message
news:01f901c3de73$64587570$a001280a@.phx.gbl...
I got an error 13 "Cannot resolve collation conflict for
equal to operation"
when trying to run some tasks
Showing posts with label equal. Show all posts
Showing posts with label equal. Show all posts
Monday, March 19, 2012
Friday, February 24, 2012
Error #403?
Hi everybody,
Can someone tell me how to resolver error #403? It's got something to do
with a operator that is equal to a divide thing.Can you show the code you're using, and the actual error message you
receive?
"Nicollo Machiaveli" <machiaveli280278@.hotmail.com> wrote in message
news:#AMCAvBXDHA.1896@.TK2MSFTNGP12.phx.gbl...
> Hi everybody,
> Can someone tell me how to resolver error #403? It's got something to do
> with a operator that is equal to a divide thing.
>|||>--Original Message--
>Can you show the code you're using, and the actual error
message you
>receive?
>
>"Nicollo Machiaveli" <machiaveli280278@.hotmail.com> wrote
in message
>news:#AMCAvBXDHA.1896@.TK2MSFTNGP12.phx.gbl...
>> Hi everybody,
>> Can someone tell me how to resolver error #403? It's
got something to do
>> with a operator that is equal to a divide thing.
>
>.
>Hi,
The expression i use is in a query, like this:
field1: 40-(Date()-[field0])/7
And the error is like this:
sql error, the operater equals divide equals dattime or
something. I will paste the actual error tommorow. I'm at
home right now.|||> field1: 40-(Date()-[field0])/7
Uh, you expect date() - field0 to return a number? It won't, it will return
a date. Maybe you could explain exactly what you are trying to do...
instead of using /7, for example, you might consider using DATEDIFF with a
parameter of WEEK.|||>--Original Message--
>> field1: 40-(Date()-[field0])/7
>Uh, you expect date() - field0 to return a number? It
won't, it will return
>a date. Maybe you could explain exactly what you are
trying to do...
>instead of using /7, for example, you might consider
using DATEDIFF with a
>parameter of WEEK.
>
>.
>Aaron,
Here's the actual errorcode:
[Microsoft][ODBC SQL Server Driver][SQL Server]Invalid
operator for data type. Operator equals divide, type
equals datetime. (#403)
And here's the query in sqlstatement:
SELECT table1.ID, table1.name, table1.DOB,
table2.Appointment, (40-([Date1]-[appointment])/7) AS
[Codenr], ([Date1]-(22*7)) AS [result], ([Date1]-(16*7))
AS [max]
FROM table1 INNER JOIN table2 ON table1.ID = table2.ID
WHERE (((table2.Appointment)>(Date()+21)) AND (((40-
([Date1]-[Appointment])/7))<18 Or ((40-([Date1]-
[Appointment])/7))>24) AND ((table1.active) Like "part*"
Or (table1.active) Like "doet*"));|||> table2.Appointment, (40-([Date1]-[appointment])/7)
Once again (is there an echo?), you're trying to divide a datetime by 7. As
the error message clearly indicates, you can't divide a datetime by
anything.
If you state your exact requirements, we can help you... in the meantime, I
have no idea what Date1 - appointment is supposed to return.
Can someone tell me how to resolver error #403? It's got something to do
with a operator that is equal to a divide thing.Can you show the code you're using, and the actual error message you
receive?
"Nicollo Machiaveli" <machiaveli280278@.hotmail.com> wrote in message
news:#AMCAvBXDHA.1896@.TK2MSFTNGP12.phx.gbl...
> Hi everybody,
> Can someone tell me how to resolver error #403? It's got something to do
> with a operator that is equal to a divide thing.
>|||>--Original Message--
>Can you show the code you're using, and the actual error
message you
>receive?
>
>"Nicollo Machiaveli" <machiaveli280278@.hotmail.com> wrote
in message
>news:#AMCAvBXDHA.1896@.TK2MSFTNGP12.phx.gbl...
>> Hi everybody,
>> Can someone tell me how to resolver error #403? It's
got something to do
>> with a operator that is equal to a divide thing.
>
>.
>Hi,
The expression i use is in a query, like this:
field1: 40-(Date()-[field0])/7
And the error is like this:
sql error, the operater equals divide equals dattime or
something. I will paste the actual error tommorow. I'm at
home right now.|||> field1: 40-(Date()-[field0])/7
Uh, you expect date() - field0 to return a number? It won't, it will return
a date. Maybe you could explain exactly what you are trying to do...
instead of using /7, for example, you might consider using DATEDIFF with a
parameter of WEEK.|||>--Original Message--
>> field1: 40-(Date()-[field0])/7
>Uh, you expect date() - field0 to return a number? It
won't, it will return
>a date. Maybe you could explain exactly what you are
trying to do...
>instead of using /7, for example, you might consider
using DATEDIFF with a
>parameter of WEEK.
>
>.
>Aaron,
Here's the actual errorcode:
[Microsoft][ODBC SQL Server Driver][SQL Server]Invalid
operator for data type. Operator equals divide, type
equals datetime. (#403)
And here's the query in sqlstatement:
SELECT table1.ID, table1.name, table1.DOB,
table2.Appointment, (40-([Date1]-[appointment])/7) AS
[Codenr], ([Date1]-(22*7)) AS [result], ([Date1]-(16*7))
AS [max]
FROM table1 INNER JOIN table2 ON table1.ID = table2.ID
WHERE (((table2.Appointment)>(Date()+21)) AND (((40-
([Date1]-[Appointment])/7))<18 Or ((40-([Date1]-
[Appointment])/7))>24) AND ((table1.active) Like "part*"
Or (table1.active) Like "doet*"));|||> table2.Appointment, (40-([Date1]-[appointment])/7)
Once again (is there an echo?), you're trying to divide a datetime by 7. As
the error message clearly indicates, you can't divide a datetime by
anything.
If you state your exact requirements, we can help you... in the meantime, I
have no idea what Date1 - appointment is supposed to return.
Subscribe to:
Posts (Atom)