I am writing this query using existing query.
select query_1018.user, CAST(Date_1 as DATETIME), Date_2 , (Date_2 - Date_1) from query_1018
inner join query_1021 on query_1021.user = query_1018.user
But as soon as I use CAST function to convert string value of output of the existing query to datetime.
It will return year value.
Basically I need to know how I can convert string to datetime and perform operation on them using values for existing query.
As per my understanding when you use values from existing query then it return every value as string datatype.
Please correct me if I am wrong and I need a help regarding this.