Solved

Operand type clash: date is incompatible with int

Posted on 2010-09-01
4
2,054 Views
Last Modified: 2012-05-10
I am attempting to write a querie that will display in a drop down dialogue box in VB that will show the invoice number and the date of the invoice together.  I thought that this would work:

SELECT (inv_no + ' - ' + date) as billinfo from billing.

I get the error Operand type clash: date is incompatible with int

inv_no is an int field in the db and date is a date field.

Anone have any ideas as to how to do this?

Thanks
0
Comment
Question by:scanimetrics
  • 2
4 Comments
 
LVL 12

Accepted Solution

by:
mcv22 earned 125 total points
ID: 33581118
SELECT CONVERT(VARCHAR(MAX), inv_no) + ' - ' + CONVERT(VARCHAR(MAX), date) as billinfo from billin
0
 
LVL 12

Assisted Solution

by:mcv22
mcv22 earned 125 total points
ID: 33581119
SELECT CONVERT(VARCHAR(MAX), inv_no) + ' - ' + CONVERT(VARCHAR(MAX), date) as billinfo from billing
0
 
LVL 6

Expert Comment

by:baretree
ID: 33581122
SELECT (CAST(inv_no AS varchar) + " - " + CONVERT(varchar, date, 101)) as field
FROM billing

that should do the trick :)
0
 

Author Closing Comment

by:scanimetrics
ID: 33581154
Thanks for the help, mcy22.  that totally did the trick.
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
SQL Pivot Rows To Columns 10 66
This query failed in sql 2014 5 33
Query Syntax 17 43
Reformat SQL - so SSRS can read the columns 25 13
Long way back, we had to take help from third party tools in order to encrypt and decrypt data.  Gradually Microsoft understood the need for this feature and started to implement it by building functionality into SQL Server. Finally, with SQL 2008, …
In this article I will describe the Detach & Attach method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question