R
Ralf
Hi All,
Assumed I've a query with more then 20 WHERE conditions, like:
SELECT * FROM table_a
WHERE
(column_a IS NOT NULL) AND
(column_b IS NOT NULL) AND
...
(column_x IS NOT NULL);
Since I use exactly the same WHERE conditions in another content, I copy and
paste it to another query. Now, when the WHERE conditions need to be changed,
I need to change it in all queries where it appears. I hoped applying a
function would facilitate this:
Public Function GetConditions() As String
GetConditions="(column_a IS NOT NULL) AND (column_b) [...]"
End Function
Now include the function in all queries:
SELECT * FROM table_a WHERE (GetConditions());
But this does not work. Now, does someone has an idea how to avoid these
annoying copy and paste activities?
Thank you,
Ralf
Assumed I've a query with more then 20 WHERE conditions, like:
SELECT * FROM table_a
WHERE
(column_a IS NOT NULL) AND
(column_b IS NOT NULL) AND
...
(column_x IS NOT NULL);
Since I use exactly the same WHERE conditions in another content, I copy and
paste it to another query. Now, when the WHERE conditions need to be changed,
I need to change it in all queries where it appears. I hoped applying a
function would facilitate this:
Public Function GetConditions() As String
GetConditions="(column_a IS NOT NULL) AND (column_b) [...]"
End Function
Now include the function in all queries:
SELECT * FROM table_a WHERE (GetConditions());
But this does not work. Now, does someone has an idea how to avoid these
annoying copy and paste activities?
Thank you,
Ralf