When I configure my SQL server datasource, what SQL statement can I use to convert a source field in a legacy DB2 database in 'mmddyy' format to a datetime field so that I can query by date on this field?
Here is the expression:
CAST(substring(Right('000000' + convert(varchar(6),DATEFIELD),6),1,2)+'/'+substring(Right('000000' + convert(varchar(6),DATEFIELD),6),3,2)+'/'+substring(Right('000000' + convert(varchar(6),DATEFIELD),6),5
,2) as smalldatetime) as variablename
No comments:
Post a Comment