T-SQL query... * Conversion failed when converting datetime from character strin

Status
Not open for further replies.

technophile

Ars Legatus Legionis
23,768
In order to use UNION, the column list for all the SELECTS must be the same (at least in type/length), since it's returning a single resultset; you're basically trying to return both the email and the last upload time as a single type, which it doesn't like.

You probably want this:
Code:
SELECT Email, LastUploadTime
FROM roA_tblUser
The table names and aliases are redundant in this query, although they won't hurt anything by being there either.
 

Richard Berg

Ars Legatus Legionis
43,037
Subscriptor
That has the exact same problem. Like technophile said, In order to use UNION, the column list for all the SELECTS must be the same (at least in type/length), since it's returning a single resultset; you're basically trying to return both the email and the last upload time as a single type, which it doesn't like.

Try:

Code:
SELECT User.Email, Account.LastUploadTime
FROM roA_tblUser AS User
JOIN roA_tblUserAccount As Account ON User.SomeKey = Account.SomeKey
 
Status
Not open for further replies.