Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQuery
Message
 
 
To
07/05/2008 09:03:21
General information
Forum:
Visual FoxPro
Category:
Stonefield
Title:
Re: SQuery
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01308261
Message ID:
01315577
Views:
21
I see, I may try something like this today. The only problem is that I don't have VFP on the computer I'm using to write reports. Would I still be able to do something like this?

I have one more question.

I have an address table. If I would design the report myself, I may use this old trick:
Address1;Address2;City,Zip

(need to verify it, but that's the idea).

Can I put something like this in the Output expression in the field?

Thanks again.

>>I have another question. I have a Phones table where type identifies the kind of the Phone. Suppose, I'd like to combine two Phones in one field (separated with Chr(13), so it would become Memo field). Is there a way to do so with Stonefield Configuration Utility?
>
>As Frank suggested, I'd created a calculated field. I'd do it in the parent table rather than the Phones table. If you do it in the Phones table, because there could be multiple records for each parent record, you'd end up with multiple instances of the same combined phones.
>
>For example, suppose Phones is a child of Customers, so there are possibly multiple Phones records for each Customer. Also suppose there's a CustomerID field in Phones that's the foreign key to Customers, which has ID as its primary key. In this case, create a calculated field in Customers called Phones and have the output expression of that field call a script and pass it the ID for the Customer record; for example, GetPhones(Customer.ID). Thee code for GetPhones would be similar to the following:
lparameters tiCustomerID
>local lnSelect, lcSelect, lcPhones
>lnSelect = select()
>lcSelect = 'select PhoneNumber, PhoneType from Phones ' + ;
>  'where CustomerID=' + transform(tiCustomerID)
>loDatabase = SQApplication.Databases.GetMainDatabase()
>loDatabase.ExecuteSQLStatement(lcSelect, , 'TempCursor')
>lcPhones = ''
>scan
>  lcPhones = lcPhones + iif(empty(lcPhones), '', chr(13)) + ;
>    trim(PhoneNumber) + ' (' + trim(PhoneType) + ')'
>endscan
>select (lnSelect)
>return lcPhones
This would display something like this in a report:
Customer A  111-111-1111 (Home)
>            222-222-2222 (Work)
>Customer B  333-333-3333 (Home)
>            444-444-4444 (Cell)
>Doug
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform