Created a new date variable in select statement, i need to add this new variable to the where clause as below;
SELECT a.bim, a.cim, b.Block,
(datename(dw, a.start_date)+ ', ' + convert (varchar(20),a.start_date,107) ) as mmm
FROM CK.SCHEDULE a
LEFT JOIN ck.Lookup b on b.date1=mmm
WHERE bim='2024'
This 'mmm' variable need to be equal 'date1' Tried cross apply but didnt work in this one.
date1 looks: Monday, July 03, 2023
start_Date looks: 2018-07-02 00:00:00.0000000