I get the following error when running my query:
“Server: Msg 260, Level 16, State 1, Line 1
Disallowed implicit conversion from data type datetime to data type timestamp, table 'trading.dbo.pricechg', column 'timestamp'. Use the CONVERT function to run this query.”
SELECT commodity_code, spot, timestamp
FROM pricechg
WHERE commodity_code = 'SILVER'
AND timestamp = (SELECT min(timestamp)
FROM pricechg
WHERE commodity_code = 'SILVER'
AND pricechg.timestamp = CONVERT(datetime,'7/16/2001'))
According to BOL I should be able to say: pricechg.timestamp = '7/16/2001'
What am I overlooking or doing wrong.
Thank you in advance for ANY help you can give.
Aaron
“Server: Msg 260, Level 16, State 1, Line 1
Disallowed implicit conversion from data type datetime to data type timestamp, table 'trading.dbo.pricechg', column 'timestamp'. Use the CONVERT function to run this query.”
SELECT commodity_code, spot, timestamp
FROM pricechg
WHERE commodity_code = 'SILVER'
AND timestamp = (SELECT min(timestamp)
FROM pricechg
WHERE commodity_code = 'SILVER'
AND pricechg.timestamp = CONVERT(datetime,'7/16/2001'))
According to BOL I should be able to say: pricechg.timestamp = '7/16/2001'
What am I overlooking or doing wrong.
Thank you in advance for ANY help you can give.
Aaron