Error - data types

  • hi guys

    I have 2 tables which I am, in effect doing 2 different Counts on.

    (The data is about call agent data per dept, and per QC person)

    in my first part (the With part) I am getting the total calls per QC person.

    Then I want, from this result set, want to get the count of calls made, PER EMPLOYEE NUMBER..where

    1. The Period is the same

    2. the Dept is the same and

    3. The QC person is the same.

    The first part of the query runs fine (the With part). But I get an error on the second part...The data types nvarchar and ntext are incompatible in the equal to operator on the indicated line in the script...

    I dont understand this...I think that the Department from the Agent_Count resultset is exactly the same data type as the cd.Department field.

    1. How can I verify this - what data type they are

    2. obviously, how can I fix the error?

    if I cant fix this, I will probably not use the WITH and just do it with Temp tables, but I'd like to do it this way...

    I enclosed my code in a file.

    thank you

  • Just convert your ntext column to nvarchar.

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply