I am trying to update a proc and need to Compare a DATETIME variable named "StartDate" which contains a full Date and Time in 24 hour format. This variable needs to have it's time component compared to a table column (named "StrTm") that is VARCHAR(10) and holds only a 4 digit number 0000 - 2359 to represent a 24 hour time format. I know I can use CONVERT(VARCHAR(10), @StartDate, 114) to get the Hour and minutes in a 24 hour format but that also gives me seconds, milliseconds, and the : separator. All of which make the comparison to the StrTm column not work. What is the easiest way to extract just the hour and minutes in a 24h format with no separators so I can properly compare @StartDate to StrTm?
-- If I get used to envying others... Those things about my self I pride will slowly fade away. -Stellvia