Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Concatenate fields

Status
Not open for further replies.

kizziebutler

Programmer
Apr 28, 2005
81
GB
I am exporting loads of data from sql 2000 to Oracle. I would like to write a stored procedure to concatenate fields. I would like to be able to convert dates, and if there is a null value this will be replace with getdate(). I would like some assistance on how to handle various fields when concatenating. Thank you

select
field1+'|',
field2+'|',
convert(varchar(10),datetimestamp,120),''),
field3
from table.
 
I recommend you post in the Microft SQL Server Programming forum instead.

Generally to conditionally do anything in MSSQL you should use the Case Statement. In this case use the Isnull function which is equivalent to the Access NZ function.

Isnull(field, getdate())

You could simply link the tables to Access, manipulate in a query there, and export the query with the pipe or whatever delimeter you want. Perhaps DTS would work too... At anyrate re-post in an appropriate forum for better help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top