Page 1 of 1

SQL statement with formula

Posted: Thu May 03, 2007 4:22 pm
by 9534375
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.

Posted: Tue May 08, 2007 10:42 am
by Pep
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).

Posted: Tue May 08, 2007 1:11 pm
by 9534375
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