jana
asked on
Ms Script to group with totals
Hi,
Please view our script to display the Following:
The script is not display what we need. the script is:
Please advice
Please view our script to display the Following:
2017-01-03, Hammer (3)
2017-01-03, Desk (2)
2017-05-10, Hammer (1)
2017-10-02, Desk (1)
2017-10-02, Hammer (2)
The script is not display what we need. the script is:
SELECT Date1, tools, COUNT(*) AS "Same-Day-USe"
FROM TableName
GROUP BY tools,Date1
HAVING COUNT(*) > 1
Please advice
the issue is at:
SELECT Date1, tools, COUNT(*) AS "Same-Day-Use"
FROM TableName
GROUP BY tools,Date1
HAVING COUNT(*) > 1
hence, try this instead:
SELECT Date1, tools, COUNT(*) AS "Same-Day-Use"
FROM TableName
GROUP BY tools,Date1
HAVING COUNT(*) > 1
hence, try this instead:
SELECT Date1, tools, COUNT(*) AS "Same-Day-Use"
FROM TableName
GROUP BY tools,Date1
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I think your ORDER is ok, seem maybe our mistake.
Worked!
So to understand the script, it would sort & group by tools/Date1, then the ' (' + cast(COUNT(*) as varchar(3)) + ')' would sum up by Tools.
Got it.
Worked!
So to understand the script, it would sort & group by tools/Date1, then the ' (' + cast(COUNT(*) as varchar(3)) + ')' would sum up by Tools.
Got it.
ASKER
Open in new window
When running the result is:
Open in new window
When it should display,
Open in new window