Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
4
Erster Beitrag:
vor 8 Jahren, 7 Monaten
Letzter Beitrag:
vor 8 Jahren, 7 Monaten
Beteiligte Autoren:
DerekT, DW, Jeff Graham, Michael

Error in Calculated Item (formula) editor

Startbeitrag von Michael am 03.01.2010 21:32

Hi All:

I 'm trying to create a Calculated Item (formula) in the Query Editor, but everything I try to write in the "SQL Code of Expression" window, I get a "Error found in expression: Check the syntax" message.

I just want to multiple two fields of a table (like Quantity * Price). How should I use this formula editor?

Thanks

Michael

Antworten:

Hi Michael,

I suggest you use selection only when building the calculated fields so that you know the fields and operators are correct. Do it in small steps and use parentheses to keep it a single value.

If that does not work, put the text you entered in a post and the field definitions.

HTH,


von Jeff Graham - am 04.01.2010 23:33
Hello Micheal,

Just tested something like this and it works.

SELECT
SUM(Cabinets.Hdw) AS sum_Hdw,
SUM(Cabinets.Install) AS sum_Install,
SUM(Cabinets.Qty*Cabinets.Hdw) AS HdwCalc,
SUM(Cabinets.Qty*Cabinets.Install) AS InstallCalc
FROM
JobRooms,
Cabinets
WHERE
Cabinets.RoomID = JobRooms.JobRoomsID
AND
(
JobRooms.BaseOpt = 'Base'
AND JobRooms.JobID = P_JobID
)

von DW - am 04.01.2010 23:53
Michael

Select the columns you require directly from the Table list.
The Query editor requires the Table and Column to build the query..........

The entry in the Formula builder will look like
MyTable1.Quantity * MyTable2.Price

The sql code would be

SELECT
MyTable1.Quantity *MyTable2PriceAS FormulaName
FROM
MyTable1
MyTable2


It is not necessary to have previously selected either Table for this to work

HTH

Regards

DerekT

von DerekT - am 05.01.2010 00:39
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.