FMabey
asked on
Format date and then convert to string
I am trying to compile a string as part of a select statement in SQL which converts a date time, firstly into the desired date format (103) and then into a VARCHAR for use in the string.
The following does not work:
dbo.SHOP_RESOURCE.DESCRIPT ION + '-' + dbo.LABOR_TICKET.WORKORDER _BASE_ID + '-' + CONVERT (varchar, dbo.LABOR_TICKET.OPERATION _SEQ_NO) + '-' + dbo.WORK_ORDER.PART_ID + '-' + CAST(CONVERT (DATETIME, dbo.LABOR_TICKET.TRANSACTI ON_DATE, 103) AS VARCHAR)
Would anyone be able to help me out on this one? I'm sure it's going to be something really easy!
Thanks
Steve
The following does not work:
dbo.SHOP_RESOURCE.DESCRIPT
Would anyone be able to help me out on this one? I'm sure it's going to be something really easy!
Thanks
Steve
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I knew it would be something simple! Thank you, was probably the only thing I hadn't tried!
Wow, that was quick - didnt even know there was another post - well done OMC2000 :)
Just use CONVERT(varchar(10),dbo.LA