Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Sum memo fields
Message
From
05/03/2012 16:31:37
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Sum memo fields
Miscellaneous
Thread ID:
01537332
Message ID:
01537332
Views:
84
Hi All -

It seems like I should know how to do this but for some reason I am drawing a blank. Suppose you have 2 tables in a 1 to many raltionship. Table1 contains data about various businesses.
Table2 (child) contains notes (memo field) about those businesses.
How do you write an sql that will sum the notes into a single field so that we end up with 1 record per business including a field with all of the notes?

Something like
SELECT table1.*, sum(table2.Notes) as Notes ;
FROM table1;
left join table2 ON key . . . .
I might add that this is VFP data exposed on a asp website. The end game is to export all of the data to excel.
Thanks for any help on this.
I'm stumped. :)
Next
Reply
Map
View

Click here to load this message in the networking platform