Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Case Statments with date time Convert

Author  Topic 

SQLMAKESMECRY
Starting Member

14 Posts

Posted - 2011-03-16 : 08:34:39
My date/time format is:
ENT_DATE
2009-06-10 13:33:14.000

Here is my convert line
SELECT convert(varchar, ent_date, 114)
from ae_p_pro_e

That returns this:
(No column name)
13:33:14:000

I am trying to sort the time to use in a Case Statement:
SELECT
CASE ent_date
WHEN between 06:00:00.000 and 18:00:00.000 THEN 'AM'
ELSE 'PM'
END AS time_class
FROM ae_p_pro_e


How do I structure the nested select in the case statement?

Help please!

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2011-03-16 : 08:52:21
duplicate of http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=158251

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -