datename (wd....)

M

Microsoft

I am getting incosistent / incorrect daynames from my data using the
datename function. I get the correct dayname and months for dates in
September but, incorrect daynames and correct months for dates in august
july etc..

the query i am using is:

SELECT
DATENAME(WEEKDAY,DAY(SaleDate)) AS Dayname,
DATENAME(MONTH(SaleDate)) AS MonthName,
SaleDate
FROM Sales

the results are:

Dayname Month Saledate
----------------------------------------------------------
Saturday August 2003-08-27 00:00:00.000 -
Incorrect (should by Wednesday)
Tuesday September 2003-09-02 00:00:00.000 - Correct


any help would be greatly appreciated

Ozz
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top