change sql parameter to date decimal
问题 I have a SQL command in crystal reports (its OK if your not familiar with crystal) and I need to convert a date parameter to a decimal (to match a column in the database.) SELECT decimaldate FROM TABLE1 WHERE decimaldate = {?normaldate} --ex: 12/01/2011 needs to become 12012011 IF I use a CAST on the above query it doesn't work: SELECT decimaldate FROM TABLE1 WHERE decimaldate = CAST(CAST{?normaldate} AS VARCHAR) AS DECIMAL) 回答1: Try something like this. select CAST(replace(convert(varchar,