Hi,
I believe that a query such as:
SELECT AsAtDate, BankMnemonic='ALL', StartOfDay etc etc
Will return the relevant rows with a column named "BankMnemonic" filled with the constant 'ALL' for each row (as well as the other normal columns).
I'm attempting to build my SQL statement on the fly:
SET @SQL = 'SELECT AsAtDate, BankMnemonic, StartOfDay, etc etc'
How do I combine these two things? ie. set BankMnemonic to be equal to 'ALL', but also build query on fly, without confusing SQL with all the apostrophes?
SET @SQL = 'SELECT AsAtDate, BankMnemonic=' + 'All' + ', StartOfDay, etc etc '
That's what I'm trying atm, but is not working...
Thanks for your help.
I believe that a query such as:
SELECT AsAtDate, BankMnemonic='ALL', StartOfDay etc etc
Will return the relevant rows with a column named "BankMnemonic" filled with the constant 'ALL' for each row (as well as the other normal columns).
I'm attempting to build my SQL statement on the fly:
SET @SQL = 'SELECT AsAtDate, BankMnemonic, StartOfDay, etc etc'
How do I combine these two things? ie. set BankMnemonic to be equal to 'ALL', but also build query on fly, without confusing SQL with all the apostrophes?
SET @SQL = 'SELECT AsAtDate, BankMnemonic=' + 'All' + ', StartOfDay, etc etc '
That's what I'm trying atm, but is not working...
Thanks for your help.