User2014201474 posted
The below is my sql statement, but it pop out error in mtsql
can tell me what the error?
Select RECID,'1' AS Seqno,'1' AS ScheduleContinues,MessageDirection
FROM tblBranch_Schedule WHERE DATEDIFF('2011-07-07', StartDate) > 0 AND DATEDIFF(EndDate, '2011-07-07')>= 0
AND BranchRECID = 'b6a2edf0-1ff1-4b21-8121-30a0197b33ea' UNION
Select RECID,'2' AS Seqno,ScheduleContinues,MessageDirection
FROM tblBranch_Schedule a where BranchRECID = 'b6a2edf0-1ff1-4b21-8121-30a0197b33ea' Order by StartDate DESC
I got the below error
Error Code: 1054. Unknown column 'StartDate' in 'order clause'