Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Operand type clash: date is incompatible with int

Posted on 2010-09-01
4
Medium Priority
?
2,074 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 12

Accepted Solution

by:
mcv22 earned 500 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 500 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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

After restoring a Microsoft SQL Server database (.bak) from backup or attaching .mdf file, you may run into "Error '15023' User or role already exists in the current database" when you use the "User Mapping" SQL Management Studio functionality to al…
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…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

661 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