Solved

Operand type clash: date is incompatible with int

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

867 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now