Solved

Operand type clash: date is incompatible with int

Posted on 2010-09-01
4
2,047 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

Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
In this article I will describe the Copy Database Wizard 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 quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

786 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