Home » Developer & Programmer » JDeveloper, Java & XML » Combine Date Field to other fields
Combine Date Field to other fields [message #465056] Mon, 12 July 2010 07:12 Go to next message
rki1966
Messages: 8
Registered: July 2010
Location: Dallas, TX
Junior Member
I am new to the board. I am not a programmer but do know how to write some sql.

I have sql code that combines several fields but I am having problem when I combine a date field to another field.

(a.FirstSector + '-' + a.PosType+ '-' + DATEPART("mm",a.HistDate)) as 'Type'

When I run the query I get the following error:

Conversion failed when converting the varchar value 'CO-L-' to data type int.

Re: Combine Date Field to other fields [message #465059 is a reply to message #465056] Mon, 12 July 2010 07:17 Go to previous messageGo to next message
cookiemonster
Messages: 10914
Registered: September 2008
Location: Rainy Manchester
Senior Member
What you've posted isn't SQL. Is it java?
Seems datepart, whatever it is, is returning an int.
Convert it to a varchar.
Re: Combine Date Field to other fields [message #465060 is a reply to message #465059] Mon, 12 July 2010 07:24 Go to previous message
rki1966
Messages: 8
Registered: July 2010
Location: Dallas, TX
Junior Member
That worked, thanks
Previous Topic: Javamail - Saving of "message/rfc822" to a BLOB column
Next Topic: Proxy user connectivity with thin driver
Goto Forum:
  


Current Time: Wed Aug 27 22:18:39 CDT 2014

Total time taken to generate the page: 0.13864 seconds