error on query datetime by month

select frmRegistrationCSWText1, count(Distinct ID) from frmRegistrationCSW where entrytime = 'january' group by frmRegistrationCSWText1

I get the following error after running the above code:
Msg 241, Level 16, State 1, Line 1
Conversion failed when converting date and/or time from character string.

How do I specifiy entrytime correctly.  datatype is datetime for that entrytime
Who is Participating?
Lee SavidgeConnect With a Mentor Commented:
where datename(m, entrytime) = 'january'

Open in new window

Lee SavidgeCommented:
You could always just use the month number:

where month(entrytime) = 1

Open in new window

Neither option of course, takes the year into account.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.