I have the following code:
DECLARE @sYEARMO AS VARCHAR(8);
SET @sYEARMO = (SELECT max(Business_Date) FROM [Exchange_Rates_Entry_Table_Daily])
PRINT @sYEARMO
TRUNCATE TABLE [Exchange_Rates_Entry_Table_Monthly]
INSERT INTO [Exchange_Rates_Entry_Table_Monthly] (
[Currency_Name],
[Currency_Whole_Name],
[Exchange_Rate],
[Business_Date],
[Currency_Symbol]
) SELECT * FROM [Exchange_Rates_Entry_Table_Daily]
Business_Date = @sYEARMO
I have tried encasing @sYEARMO in '' with a + in front of the variagble and keep receiving errors. A search of this forum and Googling has produced no information that will lead me to solving this problem. Can someone help me with this problem? Any help is appreciated. Thanks.
Dave
DECLARE @sYEARMO AS VARCHAR(8);
SET @sYEARMO = (SELECT max(Business_Date) FROM [Exchange_Rates_Entry_Table_Daily])
PRINT @sYEARMO
TRUNCATE TABLE [Exchange_Rates_Entry_Table_Monthly]
INSERT INTO [Exchange_Rates_Entry_Table_Monthly] (
[Currency_Name],
[Currency_Whole_Name],
[Exchange_Rate],
[Business_Date],
[Currency_Symbol]
) SELECT * FROM [Exchange_Rates_Entry_Table_Daily]
Business_Date = @sYEARMO
I have tried encasing @sYEARMO in '' with a + in front of the variagble and keep receiving errors. A search of this forum and Googling has produced no information that will lead me to solving this problem. Can someone help me with this problem? Any help is appreciated. Thanks.
Dave