Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2087
  • Last Modified:

Operand type clash: date is incompatible with int

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
scanimetrics
Asked:
scanimetrics
  • 2
2 Solutions
 
mcv22Commented:
SELECT CONVERT(VARCHAR(MAX), inv_no) + ' - ' + CONVERT(VARCHAR(MAX), date) as billinfo from billin
0
 
mcv22Commented:
SELECT CONVERT(VARCHAR(MAX), inv_no) + ' - ' + CONVERT(VARCHAR(MAX), date) as billinfo from billing
0
 
baretreeCommented:
SELECT (CAST(inv_no AS varchar) + " - " + CONVERT(varchar, date, 101)) as field
FROM billing

that should do the trick :)
0
 
scanimetricsAuthor Commented:
Thanks for the help, mcy22.  that totally did the trick.
0

Featured Post

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now