I have created a view which contains columns for the customer turnover for each month last year.
columns TL1 - TL12 (this can be changed as required to make it all work)
I wish to select a few other columns from this table (customer name, account code) but I wish to select ONLY one of the TL columns based on the current month.
I have been looking at the getdate command to get the month but I do not know how to link this into a select statement.
So please can someone advise how to select a specific column from a view based on the current month?
Note: MS SQL 2005