SQL statement with formula

TeeChart for ActiveX, COM and ASP
Post Reply
pro17
Newbie
Newbie
Posts: 11
Joined: Tue Feb 27, 2007 12:00 am

SQL statement with formula

Post by pro17 » Thu May 03, 2007 4:22 pm

I tried to access Database (MySQL) within IE with VBScript and prepare the data in one SQL statement like this: "select Items+80, Date from Sales"

I can get data using this statement "select Items, Date from Sales", but would like to manipulate the data as seen before.

This comes handy when using boolean data to display as histogram, where different series are located one on top of another in left axis (huh, hope you understand :-))

Hope someone can help me.

Pep
Site Admin
Site Admin
Posts: 3295
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Tue May 08, 2007 10:42 am

Hi,

I'm afraid this is not going to be possible to do it directly into the Select statement, but you can always iterate through the recordset and add the data (including the sum) manually to the Series using the AddXY (this is basically the internal source does).

pro17
Newbie
Newbie
Posts: 11
Joined: Tue Feb 27, 2007 12:00 am

Post by pro17 » Tue May 08, 2007 1:11 pm

Hi,
it does work!

The only thing that has to be done is to assign a new name (like variable name) to the "formula" part of SQL select statement.

IE: "Select Items+80 as AddedItems, Date from Sales" works as expected.

Best regards,
Gregor Jenko

Post Reply