How to solve this question of SQL

Peter Tran shared this question 5 years ago
Answered

Create a calculated field based on (quantity * item_price) from the orderitems table. Name all columns.


Using (8) above, add the $ sign appropriately into the output.

Files: view.htm

Replies (1)

photo
1

Hi Peter,

to create a calculated field with SQL you must first set the Formula Type to be "Freehand SQL":

/B1MjncGFq8R5AAAAAElFTkSuQmCC

and then enter the formula "quantity * item_price" (you do not to enter the full SQL query, only the columns between the SELECT and the FROM)

Then once you have saved your Freehand SQL Calculated field, drag it across into your report and then select "Format" for the calc field column and then select "Edit"

/72FfiVgAAPaOiAUAYO+IWAAA9o6IBQBg74hYAAD2jogFAGDviFgAAPaOiAUAYO+IWAAA9o6IBQBg7yTJv6Nu2Y2cEbNgAAAAAElFTkSuQmCC

and finally add the $ sign to the field called "Prefix":

/Zm6iIAAAAAElFTkSuQmCC

Hopefully that will help you meet your reporting requirements!

regards,

David

Leave a Comment
 
Attach a file