Home > Archive > FoxPro database connector > August 2005 > How to use convert() or cast() function ?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author How to use convert() or cast() function ?
ADMIN

2005-08-20, 7:24 am


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, 11:24 am

Try:

SELECT PADR(Address, 35) AS ShortAddress

- Rush

"ADMIN" <ADMIN@hotmail.com> wrote in message
news:ErCNe.5146$xp.2154@trnddc02...
>
> 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
>
>
>



Cindy Winegarden

2005-08-20, 1:25 pm

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
cindy_winegarden@msn
.com www.cindywinegarden.com
Blog: http://spaces.msn.com/members/cindywinegarden


"ADMIN" <ADMIN@hotmail.com> wrote in message
news:ErCNe.5146$xp.2154@trnddc02...
>
> 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
>
>
>



Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com