Hi Everyone,
I have a table in my database from which I am trying to query the data for a particular month. Now in that database table I have separate column for each month I want to come up with a query which will filter the columns and will give me only one particular month column in the query result. The column name is a combination of Month name and a text .i.e. "_RAG". I have form .i.e. Check RAG Status for All Programs on which I have one command button and a combobox28 the command button is linked to my query and the combobox has list of months for e.g. JAN, FEB, MAR etc. So I want the query to get the value from the combobox of this form and concatenate it with text "_RAG" and then filter for that column from the table Local - RAG Status. Below is what I have so far but it's not working. Please help.
Thanks for your help in advance
I have a table in my database from which I am trying to query the data for a particular month. Now in that database table I have separate column for each month I want to come up with a query which will filter the columns and will give me only one particular month column in the query result. The column name is a combination of Month name and a text .i.e. "_RAG". I have form .i.e. Check RAG Status for All Programs on which I have one command button and a combobox28 the command button is linked to my query and the combobox has list of months for e.g. JAN, FEB, MAR etc. So I want the query to get the value from the combobox of this form and concatenate it with text "_RAG" and then filter for that column from the table Local - RAG Status. Below is what I have so far but it's not working. Please help.
Code:
SELECT [Local - RAG Status].ProgramID, [Local - RAG Status].SILO, [Local - RAG Status].PROGRAM_NAME, [Local - RAG Status].MAY_RAG
FROM [Local - RAG Status]
WHERE ((([Local - RAG Status].Forms![Check RAG Status for All Programs]![combo28].Value & "_RAG")="AMBER" Or ([Local - RAG Status].Forms![Check RAG Status for All Programs]![combo28].Value & "_RAG")="RED"));
Thanks for your help in advance
