Discussion:
How to use convert() or cast() function ?
(too old to reply)
ADMIN
2005-08-20 09:09:56 UTC
Permalink
I have SQL2K in the backend and visual foxpro in front end.

My sql database has a column called address and it is in memo type.

I tried following but could not get anywhere:

select cast(address as char(35))

or

select convert(char(35), address)

What is the best method ? Please help
Rush Strong
2005-08-20 15:15:42 UTC
Permalink
Try:

SELECT PADR(Address, 35) AS ShortAddress

- Rush
Post by ADMIN
I have SQL2K in the backend and visual foxpro in front end.
My sql database has a column called address and it is in memo type.
select cast(address as char(35))
or
select convert(char(35), address)
What is the best method ? Please help
Cindy Winegarden
2005-08-20 16:53:35 UTC
Permalink
Hi Admin,

You haven't said whether you're using Cast() and Convert() in SQL
Pass-through code against your SQL back end or using them against a FoxPro
view of the data. When using in a SQL Pass-through string then they should
work; when working with a FoxPro view to the data then use PADR() as Rush
suggested.
--
Cindy Winegarden MCSD, Microsoft Visual FoxPro MVP
***@msn.com www.cindywinegarden.com
Blog: http://spaces.msn.com/members/cindywinegarden
Post by ADMIN
I have SQL2K in the backend and visual foxpro in front end.
My sql database has a column called address and it is in memo type.
select cast(address as char(35))
or
select convert(char(35), address)
What is the best method ? Please help
Loading...