thanks Ozamora for the very quick response.. I have amended the code for now like so
WITH cte
AS
(
SELECT
CONVERT(VARCHAR(@dateCastLength), QuoteDateTimeUTC, 120 as convertedDate,
QuoteDateTimeUTC as myconvertedDate
FROM TickData.dbo.EURUSD.' + @myTable + '
).....
but it doesnt like the @dateCastLength. If I replace the @dateCastLength with a number like 16 eg
CONVERT(VARCHAR(16), QuoteDateTimeUTC, 120) as convertedDate,
then it works
I have @dateCastLength declared as a varchar so should it be an int instead..
oh ps... when you said variable sub can be used anywhere... thats except in the FROM clause.. is this correct...
↧