Short answer is that no, you can't just CONVERT a DATE to DOUBLE. If you execute:
select convert(CURDATE(), sql_double)
You will get an error. This is because CURDATE
returns a date in the form MMDDYYYY. Because of the slashes, the conversion to Double fails.
You can do something like this:
select convert(
concat(
DatePart(year,curdate())
, concat(right(concat('00', DatePart(month, curdate())),2)
, right(concat('00', DatePart(day, curdate())),2))), sql_double)
But that assumes the DOUBLE is just a YYYYMMDD concatenation of the DATE value.
You need to determine what format your DOUBLE field is and adjust the algorithm to fit your needs.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…