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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using SPACE() in a Select-Sql Statement

Status
Not open for further replies.

jmueller

MIS
Oct 9, 2001
57
US
Can someone tell me how to add some additional blank fields in a sql-select stmt. For example, here's what I'm trying to do:

Select CusName, space(30) as MyFieldName from SqlTable

It doesn't like the space()! I could have sworn i've done this before... There's got to be an easy solution to this one.

Anyone?

Thanks.

Jack.
 
It doesn't give any error, it just doesn't pull down any records. I get rid of the space() function and then it works.

One other thing I forgot to mention that could be a cause is that i'm pulling from our MAS 90 tables (MAS 90 is not a SQL database) via ODBC. Could the ODBC have something to do with it?

Thanks for responding Rick. I really appreciate you taking the time to help.
 
Oh, that has everything to do with it. {g}

The SPACE() function is a VFP function, not necessarily a function compatible with a specific backend database. Your query has to work on the backend database.


_RAS
VFP MVP
 
I was afraid of that. In that case, I will look into the MAS forum for help on this. Thanks Again!
 
Jack,

With non-VFP back-ends, the following should work:


Select CusName, ' ' as MyFieldName from SqlTable


In other words, type a literal string with 30 spaces in it. Not very elegant, but if all else fails .....

Mike

Mike Lewis
Edinburgh, Scotland

My Visual Foxpro web site: My Crystal Reports web site:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top