Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2004
    Posts
    7

    Unanswered: data types conflict, but I know they don't

    Please save my sanity. Here's what I'm doing:

    INSERT INTO qtQuote (qtRev, qtQN, qtQuoteNum, qtDate, qtCustID, qtCoID,
    qtSalesID, qtInvoice, qtFile, qtPN, qtToolref, qtStenref, qtDueD,
    qtDueT, qtDelD, qtChxA, qtChxB, qtFloppy, qtChxC, qtChxD, qtOther,
    qtStatus, qtType, qtWdth, qtLgth, qtMat, qtTypeO, qtMat1, qtMat1C,
    qtMat2, qtMat2C, qtMat3, qtMat3C, qtClmps, qtClip, qtPins, qtHold,
    qtSky, qtRot, qtCust1, qtCust1C, qtUnit, qtProgH, qtProgM, qtMCH,
    qtMCM, qtMCC, qtAssH, qtAssM, qtAssC, qtOthH, qtOthM, qtOthC, qtPrem,
    qtDisc, qtNotes) VALUES ('', '222q0005', '5', getdate(), '3', '222',
    '1', '', '', '', '', '', '', '', '1', '', 'wwww', '', '', 'some crazy text',
    '1', '', '3', '54', '54', '59.00', '', '', '$0.00', '', '$0.00', '',
    '$0.00', '0', '0', '0', '0', '0', '0', '0', '$0.00', '1', '0', '0',
    '0', '0', '$60.00', '0', '0', '$60.00', '0', '0', '$0.00', '0', '0',
    '');


    but then I get this error:

    Server: Msg 245, Level 16, State 1, Line 1
    Syntax error converting the varchar value 'some crazy text' to a column of data type bit.

    but I KNOW qtOther (and qtFloppy, which this also happens to) are varchar types.... why is it telling me they are not??!?

    using SQL Server 2000 and I'm a big newbie...


    thanks!

  2. #2
    Join Date
    Jan 2003
    Location
    India
    Posts
    523

    Re: data types conflict, but I know they don't

    Originally posted by TurkeyBot
    Please save my sanity. Here's what I'm doing:

    INSERT INTO qtQuote (qtRev, qtQN, qtQuoteNum, qtDate, qtCustID, qtCoID,
    qtSalesID, qtInvoice, qtFile, qtPN, qtToolref, qtStenref, qtDueD,
    qtDueT, qtDelD, qtChxA, qtChxB, qtFloppy, qtChxC, qtChxD, qtOther,
    qtStatus, qtType, qtWdth, qtLgth, qtMat, qtTypeO, qtMat1, qtMat1C,
    qtMat2, qtMat2C, qtMat3, qtMat3C, qtClmps, qtClip, qtPins, qtHold,
    qtSky, qtRot, qtCust1, qtCust1C, qtUnit, qtProgH, qtProgM, qtMCH,
    qtMCM, qtMCC, qtAssH, qtAssM, qtAssC, qtOthH, qtOthM, qtOthC, qtPrem,
    qtDisc, qtNotes) VALUES ('', '222q0005', '5', getdate(), '3', '222',
    '1', '', '', '', '', '', '', '', '1', '', 'wwww', '', '', 'some crazy text',
    '1', '', '3', '54', '54', '59.00', '', '', '$0.00', '', '$0.00', '',
    '$0.00', '0', '0', '0', '0', '0', '0', '0', '$0.00', '1', '0', '0',
    '0', '0', '$60.00', '0', '0', '$60.00', '0', '0', '$0.00', '0', '0',
    '');


    but then I get this error:

    Server: Msg 245, Level 16, State 1, Line 1
    Syntax error converting the varchar value 'some crazy text' to a column of data type bit.

    but I KNOW qtOther (and qtFloppy, which this also happens to) are varchar types.... why is it telling me they are not??!?

    using SQL Server 2000 and I'm a big newbie...


    thanks!
    can u post the ddl for the table ? so that we will be able to help u

  3. #3
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    'some crazy text' is the 20th value in your select list. The 20th value in your insert list is qtChxD. qtOther is the 21st value in your insert list.
    Is qtChxD a bit value?
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  4. #4
    Join Date
    Jan 2004
    Posts
    7
    Thanks Blindman, that was part of the problem. It ended up having to do with the order of the columns in the Function I set up. Even though I checked them at least a half-dozen times, it's always to have another pair of eyes...

  5. #5
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    Asking the blindman for another pair of eyes...you can cut the irony with a knife.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •