new to SQL :
In the simple query below I was able to successful obtain data results. in the second query- it kept giving incorrect column name as an error. question is- if it returned data in the first query using the same operator, why didn't it work it the second? basically- we are trying to see staff who log in > 6:00pm
thank you for any help given.
select Log_ID, WFNJ_No, EOC_No, Note, Date_Created, Right(Convert(Varchar,Date_Created,100),7) as LogginTime,UserId_Created, XML_Data
Where Date_Created >= '2016-01-01 00:00:00.000'
Order by Date_Created, LogginTime
Select Username,LastActivityDate,RIGHT(CONVERT(VARCHAR, LastActivityDate, 100),7) as LogginTime
order by LogginTime