my Problem is to Display the weekday instead of the date. At the Moment this works:
SELECT
Sum(PostQuantity) AS Amount,
to_char(PostingDate, 'dd-mm-yyyy') AS Day
FROM
table1
GROUP BY to_char(PostingDate, 'dd-mm-yyyy')
ORDER BY to_char(PostingDate, 'dd-mm-yyyy')
but this will show the date. Adding functions like:
SELECT
Sum(PostQuantity) AS Amount,
DatePart(Weekday,PostingDate) AS Day
or
SELECT
Sum(PostQuantity) AS Amount,
DateName(dw,PostingDate) AS Day
won't work. I think my problem is the use of the PostingDate
in the SELECT
Operator, but my try for fixing it didn't work as well.