Home > Archive > FoxPro database connector > September 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


2005-09-03, 7:25 am

you are using an SQL Query.
you want the first 35 characters from TEXT column.
use the following in your select.

SELECT SUBSTRING(ADDRESS, 1, 35) AS Address

cast and convert works the same, but use them when you want to convert from
one type to another, for example, float to integer, datetime to
smalldatetime, char to numeric, etc..

"ADMIN" <ADMIN@hotmail.com> wrote in message
news:DrCNe.5145$xp.216@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