Quote from
Gaev on April 13, 2022, 7:26 pm
@fernando-alcocer
Database: service
Table: ticket
Fields: date,sale
I need to add the "sales" of the whole day.
1) You did not specify what database you were using (I am assuming the suggested command is supported by your Database)
2) Generally not a good idea to name fields that might conflict with "reserved words" ... might want to rename date to salesDate
I did a Google Search with this phrase ... sql to add sales by date ... this is the recommended SQL command ...
SELECT date, SUM(sale) AS "Sales For Date"
FROM ticket
GROUP BY date;
So, your VisualNEOWin might look like ...
dbpExecSQL "service" "SELECT date, SUM(sale) AS "Sales For Date" FROM ticket GROUP BY date" "Temp1"
dbpOpenTable "service" "Temp1" ""
dbpShowGrid "service" "Temp1" "Rectangle1"
Please pay special attention to upper/lower case for database, table and field names.
@fernando-alcocer
Database: service
Table: ticket
Fields: date,sale
I need to add the "sales" of the whole day.
1) You did not specify what database you were using (I am assuming the suggested command is supported by your Database)
2) Generally not a good idea to name fields that might conflict with "reserved words" ... might want to rename date to salesDate
I did a Google Search with this phrase ... sql to add sales by date ... this is the recommended SQL command ...
SELECT date, SUM(sale) AS "Sales For Date"
FROM ticket
GROUP BY date;
So, your VisualNEOWin might look like ...
dbpExecSQL "service" "SELECT date, SUM(sale) AS "Sales For Date" FROM ticket GROUP BY date" "Temp1"
dbpOpenTable "service" "Temp1" ""
dbpShowGrid "service" "Temp1" "Rectangle1"
Please pay special attention to upper/lower case for database, table and field names.
Vadim has reacted to this post.